From fc9a10ad5270c119c56da366234167ebf5290202 Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Mon, 2 May 2022 17:32:29 +0100 Subject: [PATCH] Tidy up playlist.remove_track --- app/models.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models.py b/app/models.py index b13c207..589fca5 100644 --- a/app/models.py +++ b/app/models.py @@ -342,12 +342,10 @@ class Playlists(Base): DEBUG(f"Playlist.remove_track({self.id=}, {row=})") # Get tracks collection for this playlist - tracks_collections = self.tracks # Tracks are a dictionary of tracks keyed on row # number. Remove the relevant row. - del tracks_collections[row] + del self.tracks[row] # Save the new tracks collection - self.tracks = tracks_collections session.flush()