From e9194df3485b15f132315e200512cf903475f5db Mon Sep 17 00:00:00 2001 From: Casper Sparre Date: Sat, 8 Mar 2025 14:49:43 +0100 Subject: [PATCH] Added "x of y" count to "Scraping Data For" console outputs. --- OF DL/Program.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/OF DL/Program.cs b/OF DL/Program.cs index dbc7036..db94d0f 100644 --- a/OF DL/Program.cs +++ b/OF DL/Program.cs @@ -986,9 +986,11 @@ public class Program Log.Debug($"Download path: {p}"); List purchasedTabCollections = await m_ApiHelper.GetPurchasedTab("/posts/paid", p, Config, users); - foreach(PurchasedTabCollection purchasedTabCollection in purchasedTabCollections) + int userNum = 1; + int userCount = purchasedTabCollections.Count; + foreach (PurchasedTabCollection purchasedTabCollection in purchasedTabCollections) { - AnsiConsole.Markup($"[red]\nScraping Data for {purchasedTabCollection.Username}\n[/]"); + AnsiConsole.Markup($"[red]\nScraping Data for {purchasedTabCollection.Username} ({userNum++} of {userCount})\n[/]"); string path = ""; if (!string.IsNullOrEmpty(Config.DownloadPath)) { @@ -1097,8 +1099,10 @@ public class Program } else if (hasSelectedUsersKVP.Key && !hasSelectedUsersKVP.Value.ContainsKey("ConfigChanged")) { - //Iterate over each user in the list of users - foreach (KeyValuePair user in hasSelectedUsersKVP.Value) + //Iterate over each user in the list of users + int userNum = 1; + int userCount = hasSelectedUsersKVP.Value.Count; + foreach (KeyValuePair user in hasSelectedUsersKVP.Value) { int paidPostCount = 0; int postCount = 0; @@ -1108,7 +1112,7 @@ public class Program int highlightsCount = 0; int messagesCount = 0; int paidMessagesCount = 0; - AnsiConsole.Markup($"[red]\nScraping Data for {user.Key}\n[/]"); + AnsiConsole.Markup($"[red]\nScraping Data for {user.Key} ({userNum++} of {userCount})\n[/]"); Log.Debug($"Scraping Data for {user.Key}");