From b0c05891a4dd3ea901d9e02fc0e619623b9b47c1 Mon Sep 17 00:00:00 2001
From: Bryan Van Deusen
Date: Wed, 2 Dec 2026 16:59:31 -0500
Subject: [PATCH] Revert "test: DELIBERATE BREAK, expected red, reverted next
(#8300)"
This reverts commit 2bfe6036e322f45e0d8e1844c2fb66ac1bd909ad.
---
web/src/lib/api/admin.ts | 2 +-
web/src/lib/api/paging.ts | 2 +-
web/src/lib/api/quarantine.ts | 2 +-
web/src/lib/auth/publicRoutes.ts | 2 +-
web/src/lib/components/QueueTrackRow.svelte | 3 ++-
web/src/lib/components/StageBadge.svelte | 2 +-
web/src/lib/media/duration.ts | 2 +-
web/src/lib/player/store.svelte.ts | 4 ++--
web/src/routes/playlists/[id]/+page.svelte | 2 +-
web/src/routes/register/+page.svelte | 2 +-
10 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/web/src/lib/api/admin.ts b/web/src/lib/api/admin.ts
index 34b60186..8e0f64e0 100644
--- a/web/src/lib/api/admin.ts
+++ b/web/src/lib/api/admin.ts
@@ -873,7 +873,7 @@ export async function removeWrongSlotFiles(
}
export async function dismissDuplicateGroup(id: string): Promise {
- await api.post(`/api/admin/library/duplicates/${id}/dismiss`, {});
+ await api.post(`/api/admin/library/duplicates/${encodeURIComponent(id)}/dismiss`, {});
}
// Needs a file ------------------------------------------------------
diff --git a/web/src/lib/api/paging.ts b/web/src/lib/api/paging.ts
index 44973909..c517bd3a 100644
--- a/web/src/lib/api/paging.ts
+++ b/web/src/lib/api/paging.ts
@@ -16,6 +16,6 @@ import type { Page } from './types';
export function pageGetNextPageParam() {
return (last: Page): number | undefined => {
const loaded = last.offset + last.items.length;
- return loaded === last.total ? undefined : loaded; /* DELIBERATE BREAK */
+ return loaded >= last.total ? undefined : loaded;
};
}
diff --git a/web/src/lib/api/quarantine.ts b/web/src/lib/api/quarantine.ts
index c2d9cfca..753af886 100644
--- a/web/src/lib/api/quarantine.ts
+++ b/web/src/lib/api/quarantine.ts
@@ -15,7 +15,7 @@ export type FlagParams = {
export async function flagTrack(params: FlagParams): Promise {
const body: FlagParams = { track_id: params.track_id, reason: params.reason };
- if (params.notes !== undefined) /* DELIBERATE BREAK */ body.notes = params.notes;
+ if (params.notes && params.notes.length > 0) body.notes = params.notes;
return api.post('/api/quarantine', body);
}
diff --git a/web/src/lib/auth/publicRoutes.ts b/web/src/lib/auth/publicRoutes.ts
index dbb97c51..b3afab4e 100644
--- a/web/src/lib/auth/publicRoutes.ts
+++ b/web/src/lib/auth/publicRoutes.ts
@@ -5,7 +5,7 @@
// email-link reset flow (/forgot-password, /reset-password/) is by
// definition entered without a session.
const PUBLIC_ROUTES = new Set(['/login', '/register', '/forgot-password']);
-const PUBLIC_PREFIXES = ['/reset-password']; /* DELIBERATE BREAK */
+const PUBLIC_PREFIXES = ['/reset-password/'];
export function isPublicRoute(pathname: string): boolean {
if (PUBLIC_ROUTES.has(pathname)) return true;
diff --git a/web/src/lib/components/QueueTrackRow.svelte b/web/src/lib/components/QueueTrackRow.svelte
index dcef3513..c3841f99 100644
--- a/web/src/lib/components/QueueTrackRow.svelte
+++ b/web/src/lib/components/QueueTrackRow.svelte
@@ -32,7 +32,8 @@
} else if (e.key === ' ' || e.key === 'Enter') {
// Reorder activates via arrow keys, not Space/Enter. Prevent
// default so Space doesn't scroll the queue list and Enter doesn't
- // fire the button's no-op click. /* DELIBERATE BREAK */
+ // fire the button's no-op click.
+ e.preventDefault();
}
}
diff --git a/web/src/lib/components/StageBadge.svelte b/web/src/lib/components/StageBadge.svelte
index 2bc870b7..1da8fd8d 100644
--- a/web/src/lib/components/StageBadge.svelte
+++ b/web/src/lib/components/StageBadge.svelte
@@ -5,7 +5,7 @@
let { state }: Props = $props();
-{#if state === 'in_progress' || state === 'pending'}
+{#if state === 'in_progress'}
Processing
diff --git a/web/src/lib/media/duration.ts b/web/src/lib/media/duration.ts
index 3224f4ba..90102f69 100644
--- a/web/src/lib/media/duration.ts
+++ b/web/src/lib/media/duration.ts
@@ -2,7 +2,7 @@
// `h:mm:ss` otherwise. Negative values clamp to zero (callers shouldn't
// pass them, but the UI shouldn't crash if they do).
export function formatDuration(seconds: number): string {
- const total = Math.floor(Math.abs(seconds)); /* DELIBERATE BREAK */
+ const total = Math.max(0, Math.floor(seconds));
const h = Math.floor(total / 3600);
const m = Math.floor((total % 3600) / 60);
const s = total % 60;
diff --git a/web/src/lib/player/store.svelte.ts b/web/src/lib/player/store.svelte.ts
index 80a8fa97..b2f02481 100644
--- a/web/src/lib/player/store.svelte.ts
+++ b/web/src/lib/player/store.svelte.ts
@@ -295,7 +295,7 @@ export function toggleShuffle(): void {
// Fisher-Yates shuffle over _queue[_index+1 .. end].
const arr = _queue.slice();
for (let j = arr.length - 1; j > _index; j--) {
- const r = Math.floor(_rng() * (j + 1)); /* DELIBERATE BREAK */
+ const r = Math.floor(_rng() * (j - _index)) + _index + 1;
[arr[j], arr[r]] = [arr[r], arr[j]];
}
_queue = arr;
@@ -533,7 +533,7 @@ export function removeFromQueue(idx: number): void {
// pause on the now-last remaining track at position 0 — don't
// auto-play a track the user already heard.
_index = next.length - 1;
- _state = 'loading'; /* DELIBERATE BREAK */
+ _state = 'paused';
_position = 0;
_duration = 0;
_error = null;
diff --git a/web/src/routes/playlists/[id]/+page.svelte b/web/src/routes/playlists/[id]/+page.svelte
index 9e0a4474..ab14bb36 100644
--- a/web/src/routes/playlists/[id]/+page.svelte
+++ b/web/src/routes/playlists/[id]/+page.svelte
@@ -296,7 +296,7 @@
{#if !isOwner}· by {pl.owner_username}{/if}
{#snippet tools()}
- {#if pl.kind === 'system' && pl.system_variant}
+ {#if pl.refreshable && pl.system_variant}