mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 23:05:46 +00:00
fix(analysis): CPU seed queue, single waveform emit, and log URL redaction
Serialize heavy PCM seeding through a dedicated queue with optional priority for the current track. Emit waveform-updated once per completed seed, fix Lucky Mix waveform refresh tokens, redact Subsonic URLs in logs, and align hot-cache prefetch with the queued path.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Masks Subsonic wire-auth query params so debug logs are safe to copy.
|
||||
* (`t` salt, `s` token hash, `p` password when present.)
|
||||
*/
|
||||
export function redactSubsonicUrlForLog(url: string): string {
|
||||
if (!url || !url.includes('stream.view')) return url;
|
||||
try {
|
||||
const u = new URL(url);
|
||||
// Placeholder must stay URL-safe (no `<>` — URLSearchParams percent-encodes them).
|
||||
for (const k of ['t', 's', 'p'] as const) {
|
||||
if (u.searchParams.has(k)) u.searchParams.set(k, 'REDACTED');
|
||||
}
|
||||
return u.toString();
|
||||
} catch {
|
||||
return url.replace(/([?&])(t|s|p)=([^&]*)/gi, (_m, sep: string, key: string) => `${sep}${key}=REDACTED`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user