musikr: re-add playlist deletion

This commit is contained in:
Alexander Capehart 2024-12-17 12:18:47 -05:00
parent 7e45812411
commit 93da4a69a9
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -100,7 +100,12 @@ internal data class LibraryImpl(
} }
override suspend fun deletePlaylist(playlist: Playlist): MutableLibrary { override suspend fun deletePlaylist(playlist: Playlist): MutableLibrary {
return this val playlistImpl =
requireNotNull(playlistUidMap[playlist.uid]) {
"Playlist to delete is not in this library"
}
playlistImpl.core.prePlaylist.handle.delete()
return copy(playlists = playlists - playlistImpl)
} }
private class NewPlaylistCore( private class NewPlaylistCore(