Skip to content

Commit

Permalink
Fix adding song to playlists
Browse files Browse the repository at this point in the history
  • Loading branch information
brahmkshatriya committed Sep 2, 2024
1 parent 7727467 commit a82109c
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,11 @@ class EditPlaylistViewModel @Inject constructor(
withContext(Dispatchers.IO) {
playlists.forEach { playlist ->
tryWith(extension.info) {
check(playlist.isEditable)
val loaded = client.loadPlaylist(playlist)
println("loaded : $loaded")
check(loaded.isEditable)
val tracks = client.loadTracks(loaded).loadAll()
println("tracks: ${tracks.size}")
listener?.onEnterPlaylistEditor(loaded, tracks)
client.addTracksToPlaylist(loaded, tracks, tracks.size, new)
println("added to ${loaded.title}")
listener?.onExitPlaylistEditor(loaded, tracks)
Unit
} ?: return@withContext
Expand Down

0 comments on commit a82109c

Please sign in to comment.