Fix tag id issues

This commit is contained in:
Justin Mazzocchi 2020-09-14 23:40:02 -07:00
parent 2923aa3f3c
commit 1c6a2bcff4
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C
3 changed files with 7 additions and 3 deletions

View file

@ -88,7 +88,8 @@ public extension ContentDatabase {
}
try Timeline
.filter(!(Timeline.authenticatedDefaults.map(\.id) + lists.map(\.id)).contains(Column("id")))
.filter(!(Timeline.authenticatedDefaults.map(\.id) + lists.map(\.id)).contains(Column("id"))
&& Column("listTitle") != nil)
.deleteAll($0)
}
.ignoreOutput()

View file

@ -20,7 +20,10 @@ extension Timeline: FetchableRecord, PersistableRecord {
case (let id, .some(let title)):
self = .list(MastodonList(id: id, title: title))
default:
self = .tag(row[Columns.id])
var tag: String = row[Columns.id]
tag.removeFirst()
self = .tag(tag)
}
}

View file

@ -27,7 +27,7 @@ extension Timeline: Identifiable {
case let .list(list):
return list.id
case let .tag(tag):
return "#" + tag
return "#".appending(tag).lowercased()
}
}
}