fix(likes): select all active blogs, not only self-rebloggers

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
jimandClaude Opus 5.5 committed 2026-10-21 13:31:28 -05:00
1 parent 7557c9a168
commit c5676eb084
1 file changed
+17 -25
+17 -25
View File
@@ -1366,38 +1366,30 @@ namespace URLNotesGrabberCORE
} }
else if (ignoreCooldown) else if (ignoreCooldown)
{ {
// All blogs with notes: backfill-pending OR any refresh-eligible blog, ignore cooldown // All active blogs, ignore cooldown
sql = @"SELECT B.BlogName, sql = @"SELECT BlogName,
COALESCE(B.LikesPulled, 0), COALESCE(LikesPulled, 0),
COALESCE(B.LikesCursor, 0), COALESCE(LikesCursor, 0),
COALESCE(B.LikesNewestTimestamp, 0) COALESCE(LikesNewestTimestamp, 0)
FROM Blogs B FROM Blogs
INNER JOIN Notes N ON N.NoteBlogId = B.BlogId WHERE IsActive = 1
WHERE N.TimeStamp >= 1535778000 ORDER BY COALESCE(LikesLastRefreshed, 0), BlogName;";
AND N.RootBlogId = B.BlogId
AND B.IsActive = 1" + AndIsActive("Notes", "N", DBPath) + @"
GROUP BY B.BlogName
ORDER BY MIN(N.TimeStamp);";
} }
else else
{ {
// Backfill-pending OR refresh-due (past cooldown window) // Backfill-pending OR refresh-due (past cooldown window)
sql = @"SELECT B.BlogName, sql = @"SELECT BlogName,
COALESCE(B.LikesPulled, 0), COALESCE(LikesPulled, 0),
COALESCE(B.LikesCursor, 0), COALESCE(LikesCursor, 0),
COALESCE(B.LikesNewestTimestamp, 0) COALESCE(LikesNewestTimestamp, 0)
FROM Blogs B FROM Blogs
INNER JOIN Notes N ON N.NoteBlogId = B.BlogId WHERE IsActive = 1
WHERE N.TimeStamp >= 1535778000
AND N.RootBlogId = B.BlogId
AND B.IsActive = 1" + AndIsActive("Notes", "N", DBPath) + @"
AND ( AND (
B.LikesPulled = 0 COALESCE(LikesPulled, 0) = 0
OR COALESCE(B.LikesLastRefreshed, 0) OR COALESCE(LikesLastRefreshed, 0)
< (CAST(strftime('%s','now') AS INTEGER) - (@cooldownDays * 86400)) < (CAST(strftime('%s','now') AS INTEGER) - (@cooldownDays * 86400))
) )
GROUP BY B.BlogName ORDER BY COALESCE(LikesLastRefreshed, 0), BlogName;";
ORDER BY MIN(N.TimeStamp);";
} }
using (SQLiteCommand command = new SQLiteCommand(sql, connection)) using (SQLiteCommand command = new SQLiteCommand(sql, connection))