Fix bug getting unread count for the Today smart feed — it would skip articles with no pubDate, but that did arrive today (and thus should be considered as part of Today).
This commit is contained in:
parent
7f82f9d607
commit
1466f7e919
|
@ -160,11 +160,12 @@ final class ArticlesTable: DatabaseTable {
|
|||
queue.fetch { (database) in
|
||||
|
||||
let placeholders = NSString.rs_SQLValueList(withPlaceholders: UInt(feedIDs.count))!
|
||||
let sql = "select count(*) from articles natural join statuses where feedID in \(placeholders) and datePublished > ? and read=0 and userDeleted=0;"
|
||||
let sql = "select count(*) from articles natural join statuses where feedID in \(placeholders) and (datePublished > ? or (datePublished is null and dateArrived > ?)) and read=0 and userDeleted=0;"
|
||||
|
||||
var parameters = [Any]()
|
||||
parameters += Array(feedIDs) as [Any]
|
||||
parameters += [since] as [Any]
|
||||
parameters += [since] as [Any]
|
||||
|
||||
let unreadCount = self.numberWithSQLAndParameters(sql, parameters, in: database)
|
||||
|
||||
|
|
Loading…
Reference in New Issue