1
0

Update most listened song.

This commit is contained in:
Alexander Andreev 2023-03-13 00:04:34 +04:00
parent 8f16b5d96f
commit e84a811a1d
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -189,6 +189,7 @@ func (pw *PlaylistLogWatcher) Watch(playlistPath string, n int) (err error) {
if mask&syscall.IN_MODIFY > 0 { if mask&syscall.IN_MODIFY > 0 {
lastPlayedCacheMutex.Lock() lastPlayedCacheMutex.Lock()
if songs, err := icecastLastPlayedSongs(playlistPath, 1); err == nil && len(songs) > 0 { if songs, err := icecastLastPlayedSongs(playlistPath, 1); err == nil && len(songs) > 0 {
CheckAndUpdateMostListenedSong(songs[0], currentlyPlaying)
if currentlyPlaying.Time == "" { if currentlyPlaying.Time == "" {
currentlyPlaying = songs[0] currentlyPlaying = songs[0]
} else { } else {