From b7f5ed4e5fcb3b51636a9dad79e7e80f7ebbb102 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 23 Dec 2022 08:51:37 +0100 Subject: implement local storage backend The 'local' backend is able to serve the music from a path specified by '-server-music-dir'. Add command line options to select the server port as well as a list of backends. --- youtube.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'youtube.go') diff --git a/youtube.go b/youtube.go index a3f92d7..ad715ce 100644 --- a/youtube.go +++ b/youtube.go @@ -3,7 +3,7 @@ package main import ( "fmt" "github.com/AnjanaMadu/YTSearch" - "log" + "muhq.space/go/wrms/llog" ) type YoutubeBackend struct{} @@ -15,7 +15,7 @@ func (youtube *YoutubeBackend) Play(song *Song, player *Player) { func (youtube *YoutubeBackend) Search(pattern string) []Song { results, err := ytsearch.Search(pattern) if err != nil { - log.Fatal("Youtube search failed with", err) + llog.Error(fmt.Sprintf("Youtube search failed with", err)) } songs := []Song{} @@ -31,6 +31,6 @@ func (youtube *YoutubeBackend) Search(pattern string) []Song { songs = append(songs, NewSong(result.Title, "", "youtube", result.VideoId)) } - log.Println(fmt.Sprintf("youtube found %d matching videos", len(songs))) + llog.Debug(fmt.Sprintf("youtube found %d matching videos", len(songs))) return songs } -- cgit v1.2.3