diff --git a/internal/radio/icecast.go b/internal/radio/icecast.go index 88cd322..3c6ca44 100644 --- a/internal/radio/icecast.go +++ b/internal/radio/icecast.go @@ -198,7 +198,7 @@ func (pw *PlaylistLogWatcher) Watch(playlistPath string, n int) (err error) { lastPlayedCacheMutex.Lock() songs, err := icecastLastPlayedSongs(playlistPath, 1) if err == nil && len(songs) > 0 { - CheckAndUpdateMostListenedSong(songs[0], currentlyPlaying) + CheckAndUpdateMostListenedSong(song, ¤tlyPlaying) if currentlyPlaying.Time == "" { currentlyPlaying = songs[0] } else { diff --git a/internal/radio/mostlistened.go b/internal/radio/mostlistened.go index ce7c430..7d5a8ee 100644 --- a/internal/radio/mostlistened.go +++ b/internal/radio/mostlistened.go @@ -34,7 +34,7 @@ var mostListened MostListenedSong // // So it would be fairer to give these listeners back to a song they was // listening to. -func CheckAndUpdateMostListenedSong(cur, prev Song) { +func CheckAndUpdateMostListenedSong(cur, prev *Song) { if prev.Song == "" { return }