From 78dc143e4585a3ab5a4d173f50571b4842a4e347 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 31 Jul 2023 10:23:22 +0200 Subject: implement initial loading of spotify playlists Playlist can now be added to the initial play queue with the -playlists command line flag or the playlists yaml key in the config file. To load a spotify playlist the link obtained when sharing the playlist from spotify is used. --- main.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index 8c70976..c627894 100644 --- a/main.go +++ b/main.go @@ -275,12 +275,17 @@ func main() { flag.StringVar(&config.LocalMusicDir, "serve-music-dir", config.LocalMusicDir, "local music directory to serve") flag.StringVar(&config.UploadDir, "upload-dir", config.UploadDir, "directory to upload songs to") + playlists := flag.String("playlists", "", "playlists to load") flag.Parse() if *backends != "" { config.Backends = strings.Split(*backends, " ") } + if *playlists != "" { + config.Playlists = append(config.Playlists, strings.Split(*playlists, " ")...) + } + llog.SetLogLevelFromString(config.LogLevel) config.HasUpload = slices.Contains(config.Backends, "upload") -- cgit v1.2.3