Revert "refactor play count update to be cleaner, code-wise"
This reverts commit cd52a893d4, which introduced a regression.
Pages with a tracklist may not have the same in-memory model of the track,
so it is necessary to directly inform them of play count updates.
This commit is contained in:
@@ -100,15 +100,14 @@ func (a *AlbumPage) Route() Route {
|
||||
return AlbumRoute(a.albumID)
|
||||
}
|
||||
|
||||
var _ CanShowNowPlaying = (*AlbumPage)(nil)
|
||||
|
||||
func (a *AlbumPage) OnSongChange(song *subsonic.Child) {
|
||||
func (a *AlbumPage) OnSongChange(song *subsonic.Child, lastScrobbledIfAny *subsonic.Child) {
|
||||
if song == nil {
|
||||
a.nowPlayingID = ""
|
||||
} else {
|
||||
a.nowPlayingID = song.ID
|
||||
}
|
||||
a.tracklist.SetNowPlaying(a.nowPlayingID)
|
||||
a.tracklist.IncrementPlayCount(lastScrobbledIfAny)
|
||||
}
|
||||
|
||||
func (a *AlbumPage) Reload() {
|
||||
|
||||
Reference in New Issue
Block a user