Fetch both read and unread orphaned statuses.

This commit is contained in:
Brent Simmons 2020-01-06 18:18:27 -08:00
parent 9ba0b37cf9
commit c583c4d474
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ final class StatusesTable: DatabaseTable {
var articleIDs = Set<String>()
func makeDatabaseCall(_ database: FMDatabase) {
let sql = "select articleID from statuses s where ((starred=1) || (read=0 and dateArrived > ?)) and userDeleted=0 and not exists (select 1 from articles a where a.articleID = s.articleID);"
let sql = "select articleID from statuses s where (starred=1 or dateArrived>?) and userDeleted=0 and not exists (select 1 from articles a where a.articleID = s.articleID);"
if let resultSet = database.executeQuery(sql, withArgumentsIn: [cutoffDate]) {
articleIDs = resultSet.mapToSet(self.articleIDWithRow)
}