From b46ab28615d8dae39ca4aa6e9df70c64e895c564 Mon Sep 17 00:00:00 2001 From: sherl Date: Wed, 28 Jan 2026 05:15:35 +0100 Subject: [PATCH] fix: make sure albums and artists are bound to songs --- Tools/MediaParser.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tools/MediaParser.cs b/Tools/MediaParser.cs index daf980b..fea5fd4 100644 --- a/Tools/MediaParser.cs +++ b/Tools/MediaParser.cs @@ -75,6 +75,8 @@ public static class MediaParser "ID3v2_3:Album", // Generic mp3/wav ID3 v2.3.0 ]) ?? "[Unknown Album]"; // again, weak line of defense + // TODO: Try and find genres + // Try to find relevant artists and albums Artist artist = db.Artists .FirstOrDefault(a => a.NormalizedName == artistName.ToLower()) @@ -108,6 +110,7 @@ public static class MediaParser // Is Update() safe here? db.Artists.Update(artist); db.Albums.Update(album); + db.SaveChanges(); db.Songs.Update(song); artist.Albums.Add(album); artist.Songs.Add(song); @@ -115,7 +118,7 @@ public static class MediaParser } catch (Exception e) { - Console.WriteLine("[Error: MediaParser] Failed to extract metadata from {filepath}:\n" + + Console.WriteLine($"[Error: MediaParser] Failed to extract metadata from {filepath}:\n" + $"{e}"); }