music: commit playlist rewrites

This commit is contained in:
Alexander Capehart 2025-01-08 12:10:42 -07:00
parent 58e0956cad
commit 6f2b7abbef
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -347,7 +347,8 @@ constructor(
override suspend fun rewritePlaylist(playlist: Playlist, songs: List<Song>) { override suspend fun rewritePlaylist(playlist: Playlist, songs: List<Song>) {
val library = synchronized(this) { library ?: return } val library = synchronized(this) { library ?: return }
L.d("Rewriting $playlist with ${songs.size} songs") L.d("Rewriting $playlist with ${songs.size} songs")
library.rewritePlaylist(playlist, songs) val newLibrary = library.rewritePlaylist(playlist, songs)
synchronized(this) { this.library = newLibrary }
withContext(Dispatchers.Main) { dispatchLibraryChange(device = false, user = true) } withContext(Dispatchers.Main) { dispatchLibraryChange(device = false, user = true) }
} }