From 0fffbce646d1c30397bf16e80eee65b29639f8de Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Mon, 13 Mar 2023 01:53:52 +0400 Subject: [PATCH] First try to load currently playing song. --- internal/radio/icecast.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/radio/icecast.go b/internal/radio/icecast.go index 9d040f3..9e9a07f 100644 --- a/internal/radio/icecast.go +++ b/internal/radio/icecast.go @@ -182,6 +182,10 @@ func (pw *PlaylistLogWatcher) Watch(playlistPath string, n int) (err error) { lastPlayedCache = make([]Song, 0, n) + if songs, err := icecastLastPlayedSongs(playlistPath, 1); err == nil && len(songs) > 0 { + currentlyPlaying = songs[0] + } + go func() { for { select {