From 6073719d690a434f4898f422c7dd103698c63e6b Mon Sep 17 00:00:00 2001 From: aynakeya Date: Sat, 22 Jun 2024 10:21:13 +0800 Subject: [PATCH] add multiple diange command handling --- plugin/diange/diange.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/diange/diange.go b/plugin/diange/diange.go index 3c1ce2e..9b9b197 100644 --- a/plugin/diange/diange.go +++ b/plugin/diange/diange.go @@ -15,6 +15,7 @@ import ( "fyne.io/fyne/v2/data/binding" "fyne.io/fyne/v2/widget" "github.com/AynaLivePlayer/miaosic" + "golang.org/x/exp/slices" "sort" "strings" "time" @@ -151,7 +152,8 @@ func (d *Diange) getSources() []string { } func (d *Diange) getSource(cmd string) []string { - if cmd == d.CustomCMD { + customCmds := strings.Split(d.CustomCMD, "|") + if slices.Contains(customCmds, cmd) { return d.getSources() } sources := []string{}