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:
parent
6931181916
commit
a334dbd95a
1 changed files with 7 additions and 0 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue