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