From 75cf86b3636146321986d254928c40222b2298aa Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 13 Jun 2019 22:20:18 +0200 Subject: [PATCH] Ordering songs and artists This way the order won't keep changing --- HiddenUpdater/Program.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HiddenUpdater/Program.cs b/HiddenUpdater/Program.cs index effe610..3733147 100644 --- a/HiddenUpdater/Program.cs +++ b/HiddenUpdater/Program.cs @@ -79,8 +79,9 @@ namespace HiddenUpdater } //Console.WriteLine(artistJson.ToString(Formatting.None)); - File.WriteAllText("songs.json", playlistJson.ToString()); - File.WriteAllText("artists.json", new JArray(artistJson.Children().Select(tk=>tk.Last)).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) + .OrderBy(artist=>artist["sname"])).ToString()); } } } \ No newline at end of file