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
+1 -5
View File
@@ -127,11 +127,7 @@ func (a *AlbumPage) Route() controller.Route {
}
func (a *AlbumPage) OnSongChange(track, lastScrobbledIfAny *mediaprovider.Track) {
if track == nil {
a.nowPlayingID = ""
} else {
a.nowPlayingID = track.ID
}
a.nowPlayingID = sharedutil.TrackIDOrEmptyStr(track)
a.tracklist.SetNowPlaying(a.nowPlayingID)
a.tracklist.IncrementPlayCount(sharedutil.TrackIDOrEmptyStr(lastScrobbledIfAny))
}