Skip cache-buster query for Dropbox stream URLs

This commit is contained in:
Jage9
2026-02-22 01:59:49 -05:00
parent 93bb778cd7
commit 460ad08c02
2 changed files with 10 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
// Maintainer-controlled web client version.
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
window.CHGRID_WEB_VERSION = "2026.02.22 R136";
window.CHGRID_WEB_VERSION = "2026.02.22 R137";
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
window.CHGRID_TIME_ZONE = "America/Detroit";

View File

@@ -109,6 +109,15 @@ function connectRadioChannelSource(
}
function freshStreamUrl(streamUrl: string): string {
try {
const parsed = new URL(streamUrl);
const hostname = parsed.hostname.toLowerCase();
if (hostname.endsWith('dropbox.com') || hostname.endsWith('dropboxusercontent.com')) {
return streamUrl;
}
} catch {
// Leave non-URL strings to the generic cache-buster behavior below.
}
const separator = streamUrl.includes('?') ? '&' : '?';
return `${streamUrl}${separator}chgrid_start=${Date.now()}`;
}