From 6f898b2d26c15951ecc04f808cf0513123978958 Mon Sep 17 00:00:00 2001 From: blissful Date: Thu, 2 May 2024 14:38:07 -0400 Subject: [PATCH] fix bug where playlists would write an extra MISSING every update --- rose/cache.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/rose/cache.py b/rose/cache.py index 7bf3abd..161c965 100644 --- a/rose/cache.py +++ b/rose/cache.py @@ -1744,15 +1744,13 @@ def update_cache_for_playlists( releasedate=RoseDate.parse(row["releasedate"]), suffix=Path(row["source_path"]).suffix, ) - for i, trk in enumerate(tracks): + for trk in tracks: with contextlib.suppress(KeyError): - tracks[i]["description_meta"] = desc_map[trk["uuid"]] - if trk.get("missing", False): - tracks[i]["description_meta"] += " {MISSING}" - if trk.get("missing", False) and not tracks[i]["description_meta"].endswith( + trk["description_meta"] = desc_map[trk["uuid"]] + if trk.get("missing", False) and not trk["description_meta"].endswith( " {MISSING}" ): - tracks[i]["description_meta"] += " {MISSING}" + trk["description_meta"] += " {MISSING}" # Update the playlist on disk if we have changed information. if tracks != original_tracks: