From fb6246d563f05d99e69703a40300ee13bf16ab0a Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Tue, 2 Jul 2019 21:26:53 +0200 Subject: [PATCH] Artist getting progress display --- HiddenUpdater/Program.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/HiddenUpdater/Program.cs b/HiddenUpdater/Program.cs index 3733147..5902a60 100644 --- a/HiddenUpdater/Program.cs +++ b/HiddenUpdater/Program.cs @@ -69,6 +69,8 @@ namespace HiddenUpdater Console.WriteLine(C + " / " + tracks.Total); Console.WriteLine("Getting artists..."); + C = 0; + int max = artistJson.Count; foreach (var kv in artistJson) { var artist = spotify.GetArtist((string) kv.Value["sid"]); @@ -76,8 +78,12 @@ namespace HiddenUpdater artJson["followers"] = artist?.Followers?.Total; artJson["popularity"] = artist?.Popularity; artJson["genres"] = new JArray(artist?.Genres); + C++; + if (C % 10 == 0) Console.Write("\r" + C + "/" + max + " - " + (C / (float) max) * 100 + "%"); } + Console.WriteLine("\r" + C + "/" + max + " - " + (C / (float) max) * 100 + "%"); + //Console.WriteLine(artistJson.ToString(Formatting.None)); File.WriteAllText("songs.json", new JArray(playlistJson.OrderBy(song=>song["sid"])).ToString()); File.WriteAllText("artists.json", new JArray(artistJson.Children().Select(tk=>tk.Last)