Artist getting progress display
This commit is contained in:
parent
75cf86b363
commit
fb6246d563
1 changed files with 6 additions and 0 deletions
|
@ -69,6 +69,8 @@ namespace HiddenUpdater
|
||||||
Console.WriteLine(C + " / " + tracks.Total);
|
Console.WriteLine(C + " / " + tracks.Total);
|
||||||
|
|
||||||
Console.WriteLine("Getting artists...");
|
Console.WriteLine("Getting artists...");
|
||||||
|
C = 0;
|
||||||
|
int max = artistJson.Count;
|
||||||
foreach (var kv in artistJson)
|
foreach (var kv in artistJson)
|
||||||
{
|
{
|
||||||
var artist = spotify.GetArtist((string) kv.Value["sid"]);
|
var artist = spotify.GetArtist((string) kv.Value["sid"]);
|
||||||
|
@ -76,8 +78,12 @@ namespace HiddenUpdater
|
||||||
artJson["followers"] = artist?.Followers?.Total;
|
artJson["followers"] = artist?.Followers?.Total;
|
||||||
artJson["popularity"] = artist?.Popularity;
|
artJson["popularity"] = artist?.Popularity;
|
||||||
artJson["genres"] = new JArray(artist?.Genres);
|
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));
|
//Console.WriteLine(artistJson.ToString(Formatting.None));
|
||||||
File.WriteAllText("songs.json", new JArray(playlistJson.OrderBy(song=>song["sid"])).ToString());
|
File.WriteAllText("songs.json", new JArray(playlistJson.OrderBy(song=>song["sid"])).ToString());
|
||||||
File.WriteAllText("artists.json", new JArray(artistJson.Children().Select(tk=>tk.Last)
|
File.WriteAllText("artists.json", new JArray(artistJson.Children().Select(tk=>tk.Last)
|
||||||
|
|
Loading…
Reference in a new issue