update playlists if some tracks are deleted

This commit is contained in:
tibbi 2020-10-23 12:41:42 +02:00
parent 99a02e69e8
commit 4a57a91f1d

View file

@ -23,6 +23,7 @@ import com.simplemobiletools.musicplayer.interfaces.QueueItemsDao
import com.simplemobiletools.musicplayer.interfaces.SongsDao import com.simplemobiletools.musicplayer.interfaces.SongsDao
import com.simplemobiletools.musicplayer.models.* import com.simplemobiletools.musicplayer.models.*
import com.simplemobiletools.musicplayer.services.MusicService import com.simplemobiletools.musicplayer.services.MusicService
import org.greenrobot.eventbus.EventBus
import java.io.File import java.io.File
@SuppressLint("NewApi") @SuppressLint("NewApi")
@ -347,5 +348,7 @@ fun Context.deleteTracks(tracks: List<Track>, callback: () -> Unit) {
} }
} }
tracksDAO.removeSongsFromPlaylists(tracks)
EventBus.getDefault().post(Events.PlaylistsUpdated())
callback() callback()
} }