fix: -collect mode now processes all posts instead of exiting after first

Changed CollectNotes from async void to async Task and await it with
.GetAwaiter().GetResult() to match the pattern used by -replies and -likes.
Previously the method would return immediately after the first await,
causing Main to exit before the loop could process more than one post.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
jim
2026-05-09 20:24:50 -05:00
co-authored by Claude Opus 4.7
parent 349b465f8a
commit 4f00adcc05
+2 -2
View File
@@ -244,7 +244,7 @@ namespace URLNotesGrabberCORE
}
}
CollectNotes(settings.GetValue<string>("PathOutput"), withoutNotesOnly, beforeDate);
CollectNotes(settings.GetValue<string>("PathOutput"), withoutNotesOnly, beforeDate).GetAwaiter().GetResult();
break;
case "-blogsR": //collect notes from all posts
@@ -1073,7 +1073,7 @@ namespace URLNotesGrabberCORE
return "UNKNOWN";
}
static async void CollectNotes(string outPath, bool withoutNotesOnly = true, DateTime? beforeDate = null)
static async Task CollectNotes(string outPath, bool withoutNotesOnly = true, DateTime? beforeDate = null)
{
List<Tuple<string, long, long, long>> posts = DataAccess.GetPosts(withoutNotesOnly, beforeDate);