Merge pull request #526 from Maxmystere/fix-notification-star

Fix no server call when starring song from notification
This commit is contained in:
tzugen 2021-06-19 23:48:29 +02:00 committed by GitHub
commit ffe67e6c50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -454,6 +454,19 @@ class MediaPlayerController(
if (localMediaPlayer.currentPlaying == null) return
val song = localMediaPlayer.currentPlaying!!.song
Thread {
val musicService = getMusicService()
try {
if (song.starred) {
musicService.unstar(song.id, null, null)
} else {
musicService.star(song.id, null, null)
}
} catch (all: Exception) {
Timber.e(all)
}
}.start()
// Trigger an update
localMediaPlayer.setCurrentPlaying(localMediaPlayer.currentPlaying)
song.starred = !song.starred