feat(media): forward the audio copy format to CarrierNode

The stream proxy passes format=mp3 through, so an audio file browsers cannot play (WMA) can be served
as an MP3 copy that CarrierNode makes once and keeps.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude Code committed 2026-11-21 15:14:35 +01:00
1 parent 5745995a34
commit cf19a057c5
2 files changed
+4 -2

No files matched your search

+3 -2
View File
@@ -140,10 +140,11 @@ func (c *Service) streamMediaIdentifier(w http.ResponseWriter, r *http.Request,
// streamUpstreamPath is the CarrierNode request path for a stream. CarrierNode answers with a live
// H.264 copy when the query carries quality (a height) and start (seconds), which is how browsers get
// containers they cannot decode. Those two parameters are the only ones forwarded.
// containers they cannot decode, and with an MP3 copy of an audio file when it carries format=mp3.
// Those parameters are the only ones forwarded.
func streamUpstreamPath(upstream string, query url.Values) string {
forward := url.Values{}
for _, key := range []string{"quality", "start"} {
for _, key := range []string{"quality", "start", "format"} {
if value := strings.TrimSpace(query.Get(key)); value != "" {
forward.Set(key, value)
}