Merge pull request #526 from Maxmystere/fix-notification-star
Fix no server call when starring song from notification
This commit is contained in:
commit
ffe67e6c50
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue