From aaa94c2bc749e354471c778af04ff6f5138237b1 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Mon, 28 Aug 2023 03:07:59 -0500 Subject: [PATCH] fix: Fix YouTube service trying to be created when the API key is not set --- cmd/cmd.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index 39161a4..177f1ee 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -80,8 +80,10 @@ func run(cmd *cobra.Command, args []string) (err error) { ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT) defer cancel() - if err := youtube.CreateService(ctx); err != nil { - return err + if config.Default.YouTubeAPIKey != "" { + if err := youtube.CreateService(ctx); err != nil { + return err + } } entries, err := device.BeginDiscover(ctx)