refactor play count update to be cleaner, code-wise

This commit is contained in:
Drew Weymouth
2023-02-20 19:24:47 -08:00
parent 2f4c9ccf34
commit cd52a893d4
8 changed files with 28 additions and 36 deletions
+3 -2
View File
@@ -79,14 +79,15 @@ func (a *NowPlayingPage) SelectAll() {
a.tracklist.SelectAll()
}
func (a *NowPlayingPage) OnSongChange(song *subsonic.Child, lastScrobbledIfAny *subsonic.Child) {
var _ CanShowNowPlaying = (*NowPlayingPage)(nil)
func (a *NowPlayingPage) 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 *NowPlayingPage) Reload() {