add multiple diange command handling

This commit is contained in:
aynakeya
2024-06-22 10:21:13 +08:00
parent c9d84b1134
commit 6073719d69

View File

@@ -15,6 +15,7 @@ import (
"fyne.io/fyne/v2/data/binding" "fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/widget"
"github.com/AynaLivePlayer/miaosic" "github.com/AynaLivePlayer/miaosic"
"golang.org/x/exp/slices"
"sort" "sort"
"strings" "strings"
"time" "time"
@@ -151,7 +152,8 @@ func (d *Diange) getSources() []string {
} }
func (d *Diange) getSource(cmd string) []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() return d.getSources()
} }
sources := []string{} sources := []string{}