Fix: Relative Upload-Pfade zu absoluten Backend-URLs in Playlist

Agent ergänzt relative src-Pfade (/uploads/...) mit ServerBaseURL
beim Playlist-Fetch, damit Chromium Medien direkt vom Backend lädt
statt 404 auf dem lokalen Agent-Server zu bekommen.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jesko Anschütz 2026-03-23 12:08:19 +01:00
parent 6931181916
commit a334dbd95a

View file

@ -8,6 +8,7 @@ import (
"log" "log"
"net/http" "net/http"
"os" "os"
"strings"
"sync" "sync"
"time" "time"
@ -347,6 +348,12 @@ func (a *App) fetchPlaylist(ctx context.Context) {
return return
} }
for i := range pr.Items {
if strings.HasPrefix(pr.Items[i].Src, "/") {
pr.Items[i].Src = a.Config.ServerBaseURL + pr.Items[i].Src
}
}
a.playlistMu.Lock() a.playlistMu.Lock()
a.playlist = pr.Items a.playlist = pr.Items
a.playlistMu.Unlock() a.playlistMu.Unlock()