diff --git a/internal/radio/song.go b/internal/radio/song.go index 112a78d..bbfd05d 100644 --- a/internal/radio/song.go +++ b/internal/radio/song.go @@ -47,11 +47,18 @@ func NewSongList(length int) *SongList { func (sl *SongList) Add(newSong Song_) { sl.mut.Lock() defer sl.mut.Unlock() + + if sl.current.StartAt.Year() == 1 { + sl.current = newSong + return + } + if len(sl.lastSongs) == sl.listMaxLen { sl.lastSongs = append(sl.lastSongs[1:], sl.current) } else { sl.lastSongs = append(sl.lastSongs, sl.current) } + sl.current = newSong }