From 183b03ee64490e8e3eba5c12e46c06f0c5d42ae2 Mon Sep 17 00:00:00 2001 From: acute_interpreter_panic <223899499+acute-interpreter-panic@users.noreply.github.com> Date: Tue, 7 Oct 2025 21:03:51 +0200 Subject: [PATCH] config settings in argument --- internal/plugin/interface.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/plugin/interface.go b/internal/plugin/interface.go index 42dd061..95c91c8 100644 --- a/internal/plugin/interface.go +++ b/internal/plugin/interface.go @@ -142,11 +142,15 @@ func Fetch(source data.Source) (data.MusicObject, error) { return nil, nil } -func Search(search string) ([]data.MusicObject, error) { +type SearchConfig struct { + IgnoreErrors bool +} + +func Search(search string, config SearchConfig) ([]data.MusicObject, error) { query, err := common.NewQuery(search) res := []data.MusicObject{} - if err != nil { + if err != nil && !config.IgnoreErrors { return res, err } @@ -154,7 +158,7 @@ func Search(search string) ([]data.MusicObject, error) { s, err := plugin.Search(query) res = append(res, s...) - if err != nil { + if err != nil && !config.IgnoreErrors { return res, err } }