Skip cache-buster query for Dropbox stream URLs
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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()}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user