Skip to content

Commit

Permalink
fix bug where playlists would write an extra MISSING every update
Browse files Browse the repository at this point in the history
  • Loading branch information
azuline committed May 2, 2024
1 parent 0f3e1e4 commit 6f898b2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions rose/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6f898b2

Please sign in to comment.