feat: support internet radio stations for jukebox

fixes #481
This commit is contained in:
sentriz
2024-03-11 19:21:05 +01:00
parent 6ce1fe5a7e
commit 62d49a33d1
3 changed files with 15 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ import (
"path/filepath"
"regexp"
"strconv"
"strings"
"sync"
"time"
@@ -133,7 +134,9 @@ func (j *Jukebox) SetPlaylist(items []string) error {
var newPlayingIndex = -1
for i, item := range items {
item, _ = filepath.Abs(item)
if !strings.HasPrefix(item, "http") {
item, _ = filepath.Abs(item)
}
if currentPlayingIndex >= 0 && playlist[currentPlayingIndex].Filename == item {
newPlayingIndex = i
continue // don't add current track to loadlist