diff --git a/URLNotesGrabberCORE/DataAccess.cs b/URLNotesGrabberCORE/DataAccess.cs index 42a6d5f..3dee8a5 100644 --- a/URLNotesGrabberCORE/DataAccess.cs +++ b/URLNotesGrabberCORE/DataAccess.cs @@ -1366,8 +1366,7 @@ namespace URLNotesGrabberCORE } else { - // Least recently refreshed first; within that, blogs that have left a note before those - // that never have, earliest first note first + // Only blogs that have left a note; least recently refreshed first, then earliest first note string dueFilter = ignoreCooldown ? string.Empty : @" AND ( COALESCE(B.LikesPulled, 0) = 0 @@ -1379,12 +1378,11 @@ namespace URLNotesGrabberCORE COALESCE(B.LikesCursor, 0), COALESCE(B.LikesNewestTimestamp, 0) FROM Blogs B - LEFT JOIN (SELECT N.NoteBlogId, MIN(N.TimeStamp) AS FirstNoteTs + INNER JOIN (SELECT N.NoteBlogId, MIN(N.TimeStamp) AS FirstNoteTs FROM Notes N" + WhereIsActive("Notes", "N", DBPath) + @" GROUP BY N.NoteBlogId) F ON F.NoteBlogId = B.BlogId WHERE B.IsActive = 1" + dueFilter + @" ORDER BY COALESCE(B.LikesLastRefreshed, 0), - F.FirstNoteTs IS NULL, F.FirstNoteTs, B.BlogName;"; }