Merge branch 'claude/blogs-likes-criteria-5dca9a' into master

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