diff --git a/internal/radio/icecast.go b/internal/radio/icecast.go index 40a2dff..f8a48a2 100644 --- a/internal/radio/icecast.go +++ b/internal/radio/icecast.go @@ -22,6 +22,11 @@ const ( bufferSize = 8192 ) +var ( + lastPlayedCache []Song = make([]Song, 10) + lastPlayedCacheMutex sync.Mutex +) + type IcecastStatusDTO struct { Icestats struct { ServerStartISO8601 string `json:"server_start_iso8601"` @@ -158,8 +163,6 @@ func lastPlayedSong(playlistPath string) (*Song, error) { var playlistWatcher watcher.InotifyWatcher var playlistFired chan uint32 = make(chan uint32) -var lastPlayedCache []Song = make([]Song, 10) -var lastPlayedCacheMutex sync.Mutex func IcecastWatchPlaylist(playlistPath string, lastNSongs int) error { playlistWatcher, err := watcher.NewInotifyWatcher()