Tidy up playlist.remove_track

This commit is contained in:
Keith Edmunds 2022-05-02 17:32:29 +01:00
parent 8b644ee236
commit fc9a10ad52

View File

@ -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()