tweak GetPosts beforeDate filter and broaden GetBlogsForLikes
- GetPosts: match NotesGatheredDateTime = 0 instead of IS NULL for the beforeDate cutoff. - GetBlogsForLikes: drop the EXISTS-Posts predicate so blogs with notes but no posts rows are still eligible for likes collection. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
@@ -665,7 +665,7 @@ namespace URLNotesGrabberCORE
|
|||||||
if (beforeDate.HasValue)
|
if (beforeDate.HasValue)
|
||||||
{
|
{
|
||||||
long unixTimestamp = new DateTimeOffset(beforeDate.Value).ToUnixTimeSeconds();
|
long unixTimestamp = new DateTimeOffset(beforeDate.Value).ToUnixTimeSeconds();
|
||||||
sql += $" AND (NotesGatheredDateTime < {unixTimestamp} OR NotesGatheredDateTime IS NULL) " + Environment.NewLine;
|
sql += $" AND (NotesGatheredDateTime < {unixTimestamp} OR NotesGatheredDateTime= 0) " + Environment.NewLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
sql += "GROUP BY " + Environment.NewLine +
|
sql += "GROUP BY " + Environment.NewLine +
|
||||||
@@ -972,7 +972,7 @@ namespace URLNotesGrabberCORE
|
|||||||
if (!string.IsNullOrEmpty(specificBlog))
|
if (!string.IsNullOrEmpty(specificBlog))
|
||||||
sql = "SELECT BlogName, COALESCE(LikesPulled, 0), COALESCE(LikesCursor, 0) FROM Blogs WHERE BlogName = @blog";
|
sql = "SELECT BlogName, COALESCE(LikesPulled, 0), COALESCE(LikesCursor, 0) FROM Blogs WHERE BlogName = @blog";
|
||||||
else
|
else
|
||||||
sql = "SELECT B.BlogName, COALESCE(LikesPulled, 0), COALESCE(LikesCursor, 0) FROM Blogs B INNER JOIN Notes N ON N.NoteBlogName = B.BlogName WHERE B.LikesPulled = 0 AND N.TimeStamp >= 1535778000 AND N.rootBlogName = B.BlogName AND EXISTS (SELECT 1 FROM Posts P WHERE P.BlogName = B.BlogName) GROUP BY B.BlogName ORDER BY MIN(N.Timestamp);";
|
sql = "SELECT B.BlogName, COALESCE(LikesPulled, 0), COALESCE(LikesCursor, 0) FROM Blogs B INNER JOIN Notes N ON N.NoteBlogName = B.BlogName WHERE B.LikesPulled = 0 AND N.TimeStamp >= 1535778000 AND N.rootBlogName = B.BlogName GROUP BY B.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