few cleanups around handling track change callback

This commit is contained in:
Drew Weymouth
2023-08-04 23:39:14 -04:00
parent 5c9d338b62
commit 64ec698202
5 changed files with 15 additions and 22 deletions
+2 -6
View File
@@ -125,12 +125,8 @@ func (a *PlaylistPage) Route() controller.Route {
return controller.PlaylistRoute(a.playlistID)
}
func (a *PlaylistPage) OnSongChange(song, lastScrobbledIfAny *mediaprovider.Track) {
if song == nil {
a.nowPlayingID = ""
} else {
a.nowPlayingID = song.ID
}
func (a *PlaylistPage) OnSongChange(track, lastScrobbledIfAny *mediaprovider.Track) {
a.nowPlayingID = sharedutil.TrackIDOrEmptyStr(track)
a.tracklist.SetNowPlaying(a.nowPlayingID)
a.tracklist.IncrementPlayCount(sharedutil.TrackIDOrEmptyStr(lastScrobbledIfAny))
}