fix: mark replies '?' after pagination yields no reply notes
Previously, the '?' marker only fired when page 1 returned empty notes. Posts whose page 1 contained only likes/reblogs and whose page 2 came back empty were never marked, so GetRepliesWithFilledText kept reselecting them every iteration. Now mark after the pagination loop whenever rowsUpdated==0 and at least one page returned 200 OK. UpdateAllNoteReplyTextForPost now returns int so the caller can fold the count into emptyReplyCount/rowsUpdated for accurate Done logging. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
@@ -1515,7 +1515,7 @@ namespace URLNotesGrabberCORE
|
||||
return rowsAffected;
|
||||
}
|
||||
|
||||
public static void UpdateAllNoteReplyTextForPost(string rootBlogName, long postID, string replyText, string? DBPath = null)
|
||||
public static int UpdateAllNoteReplyTextForPost(string rootBlogName, long postID, string replyText, string? DBPath = null)
|
||||
{
|
||||
DBPath ??= GetDefaultDbPath();
|
||||
SQLiteConnection connection = new SQLiteConnection("Data Source=" + DBPath);
|
||||
@@ -1532,7 +1532,7 @@ namespace URLNotesGrabberCORE
|
||||
command.Parameters.AddWithValue("@rootBlogName", rootBlogName);
|
||||
command.Parameters.AddWithValue("@PostID", postID);
|
||||
int rowsAffected = command.ExecuteNonQuery();
|
||||
|
||||
|
||||
if (rowsAffected == 0)
|
||||
{
|
||||
Console.WriteLine($"[UpdateAllNoteReplyTextForPost] INFO: No rows updated for {rootBlogName}/{postID} (rows not found or values unchanged)");
|
||||
@@ -1543,6 +1543,8 @@ namespace URLNotesGrabberCORE
|
||||
{
|
||||
Console.WriteLine($"[UpdateAllNoteReplyTextForPost] Successfully updated {rowsAffected} row(s) for {rootBlogName}/{postID} with '{replyText}'");
|
||||
}
|
||||
|
||||
return rowsAffected;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -1550,6 +1552,7 @@ namespace URLNotesGrabberCORE
|
||||
// Breakpoint here
|
||||
Console.WriteLine($"[UpdateAllNoteReplyTextForPost] Error updating reply text: {ex.Message}");
|
||||
Console.WriteLine($"[UpdateAllNoteReplyTextForPost] StackTrace: {ex.StackTrace}");
|
||||
return 0;
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user