From 349b465f8aa61ead6e36baf5bdd34db71bbf1bb3 Mon Sep 17 00:00:00 2001 From: jim Date: Fri, 8 May 2026 21:42:30 -0500 Subject: [PATCH] fix: release 404 posts from -replies queue Tumblr API 404s were leaving Posts.NotFound=0 and Notes.replyText='.', so GetRepliesWithFilledText kept re-selecting the same dead post and the loop spun forever. Mark NotFound=1 and replies '?' on 404. Co-Authored-By: Claude Opus 4.7 --- URLNotesGrabberCORE/Program.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/URLNotesGrabberCORE/Program.cs b/URLNotesGrabberCORE/Program.cs index 2e2a875..5b936f8 100644 --- a/URLNotesGrabberCORE/Program.cs +++ b/URLNotesGrabberCORE/Program.cs @@ -492,6 +492,19 @@ namespace URLNotesGrabberCORE var raw = postsResponse?.rawJson ?? string.Empty; if (raw.Length > 500) raw = raw.Substring(0, 500) + "...[truncated]"; Console.WriteLine($"[Reply Text] raw: {raw}"); + + bool isNotFound = postsResponse?.meta?.status == 404 + || string.Equals(postsResponse?.statusCode, "NotFound", StringComparison.OrdinalIgnoreCase); + if (isNotFound) + { + var notFoundColor = Console.ForegroundColor; + Console.ForegroundColor = ConsoleColor.Yellow; + Console.WriteLine($"[Reply Text] Post {blogName}.tumblr.com/post/{postID} returned 404 - marking NotFound=1 and replies '?'"); + Console.ForegroundColor = notFoundColor; + DataAccess.UpdatePostMarkNotFound(blogName, postID); + rowsUpdated += DataAccess.UpdateAllNoteReplyTextForPost(blogName, postID, "?"); + emptyReplyCount += rowsUpdated; + } break; }