Update most listened song.
This commit is contained in:
parent
8f16b5d96f
commit
e84a811a1d
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user