Auto-proxy emit sound URLs using radio proxy rules

This commit is contained in:
Jage9
2026-02-22 03:06:31 -05:00
parent f56d89e22e
commit 45039194e1
3 changed files with 15 additions and 5 deletions

View File

@@ -6,7 +6,14 @@ import {
clampEffectLevel,
type EffectId,
} from './audio/effects';
import { RadioStationRuntime, normalizeRadioChannel, normalizeRadioEffect, normalizeRadioEffectValue } from './audio/radioStationRuntime';
import {
RadioStationRuntime,
getProxyUrlForStream,
normalizeRadioChannel,
normalizeRadioEffect,
normalizeRadioEffectValue,
shouldProxyStreamUrl,
} from './audio/radioStationRuntime';
import { ItemEmitRuntime } from './audio/itemEmitRuntime';
import { normalizeDegrees } from './audio/spatial';
import {
@@ -466,7 +473,10 @@ function classifySystemMessageSound(message: string): keyof typeof SYSTEM_SOUND_
function resolveIncomingSoundUrl(url: string): string {
const raw = String(url || '').trim();
if (!raw) return '';
if (/^(https?:|data:|blob:)/i.test(raw)) return raw;
if (/^https?:/i.test(raw)) {
return shouldProxyStreamUrl(raw) ? getProxyUrlForStream(raw) : raw;
}
if (/^(data:|blob:)/i.test(raw)) return raw;
if (raw.startsWith('/sounds/')) {
return withBase(raw.slice(1));
}