refactor play count update to be cleaner, code-wise
This commit is contained in:
@@ -86,14 +86,15 @@ func (a *PlaylistPage) Route() Route {
|
||||
return PlaylistRoute(a.playlistID)
|
||||
}
|
||||
|
||||
func (a *PlaylistPage) OnSongChange(song *subsonic.Child, lastScrobbledIfAny *subsonic.Child) {
|
||||
var _ CanShowNowPlaying = (*PlaylistPage)(nil)
|
||||
|
||||
func (a *PlaylistPage) OnSongChange(song *subsonic.Child) {
|
||||
if song == nil {
|
||||
a.nowPlayingID = ""
|
||||
} else {
|
||||
a.nowPlayingID = song.ID
|
||||
}
|
||||
a.tracklist.SetNowPlaying(a.nowPlayingID)
|
||||
a.tracklist.IncrementPlayCount(lastScrobbledIfAny)
|
||||
}
|
||||
|
||||
func (a *PlaylistPage) Reload() {
|
||||
|
||||
Reference in New Issue
Block a user