Tidy up playlist.remove_track
This commit is contained in:
parent
8b644ee236
commit
fc9a10ad52
@ -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()
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user