Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
445b52f0c8 | ||
|
|
c5676eb084 |
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user