fix: admin bugs from the audit: a playback-error delete no longer reports failure, a failed Overview load no longer reads as all-clear, and email settings can't be saved over with defaults (M503 #5604)
release / govulncheck (push) Successful in 16s
release / web (push) Successful in 1m31s
release / go (push) Successful in 1m49s
release / integration (push) Successful in 5m20s
release / Build signed APK (releases and dev) (push) Successful in 5m9s
release / android (push) Successful in 6m26s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 25s
release / Verify release artifacts (tag releases only) (push) Skipped

- Playback errors: Delete file stops resolving the error row the track
  deletion already took with it (ON DELETE CASCADE), which 404'd into
  "Delete failed".
- Overview: a queue that fails to load says so with Try again, and its tile
  shows a dash, not 0. Delete via Lidarr shows only for an album Lidarr
  holds while Lidarr is connected. An approve refreshes the Collection.
- Quarantine: Delete via Lidarr is in the row menu, so a phone reaches it;
  "1 report", not "1 reports".
- Duplicates: the Keep badge follows the copy picked.
- Integrations: provider save failures and load errors are said, not
  swallowed or shown as "No providers registered"; the Lidarr test catches
  a failed call; SMTP fills once and Save stays off until it has loaded.
  Lidarr's blurb says what it is still used for.
- Requests: release profiles point at Collection › Following.
- Library: an empty library sends an admin to Admin to run a scan, and
  tells anyone else the admin scans it, instead of opening Settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 09:40:11 -04:00
co-authored by Claude Opus 5.5
parent c94c09aeae
commit 7c89e59536
14 changed files with 343 additions and 95 deletions
+24 -13
View File
@@ -7,6 +7,7 @@
import ListContinuation from '#lib/components/ListContinuation.svelte';
import QuickFilter from '#lib/components/QuickFilter.svelte';
import EmptyState from '#lib/components/EmptyState.svelte';
import { user } from '#lib/auth/user.svelte.js';
import { useDelayed } from '#lib/utils/useDelayed.svelte.js';
import type { AlbumRef } from '#lib/api/types.js';
@@ -48,19 +49,29 @@
{:else if showSkeleton.value && albums.length === 0}
<p class="text-text-secondary">Loading…</p>
{:else if !query.isPending && total === 0}
<EmptyState
title="No albums yet"
hint="Once a library folder has been scanned, albums will appear here."
>
{#snippet actions()}
<a
href="/settings"
class="inline-flex items-center rounded-md bg-action-secondary px-4 py-2 text-sm text-action-fg hover:opacity-90"
>
Open settings
</a>
{/snippet}
</EmptyState>
<!-- Library folders are server config (library.scan_paths), not a
setting, so only an admin can act: they run a scan from Admin.
Everyone else is told whose job it is (#5604). -->
{#if user.value?.is_admin}
<EmptyState
title="No albums yet"
hint="Library folders are set in the server's config. Once they're scanned, albums appear here."
>
{#snippet actions()}
<a
href="/admin"
class="inline-flex items-center rounded-md bg-action-secondary px-4 py-2 text-sm text-action-fg hover:opacity-90"
>
Run a scan
</a>
{/snippet}
</EmptyState>
{:else}
<EmptyState
title="No albums yet"
hint="Once your server's admin has scanned the library, albums appear here."
/>
{/if}
{:else if filter.trim() && filtered.length === 0}
<p class="text-text-secondary">
No albums in your loaded library match
@@ -0,0 +1,46 @@
import { afterEach, describe, expect, test, vi } from 'vitest';
import { cleanup, render, screen } from '@testing-library/svelte';
import { readable } from 'svelte/store';
import { apiClientMock } from '../../../test-utils/mocks/client';
vi.mock('#lib/api/albums.js', () => ({
createAlbumsAlphaInfiniteQuery: () =>
readable({
data: { pages: [{ items: [], total: 0, limit: 50, offset: 0 }] },
isPending: false,
isError: false,
hasNextPage: false,
isFetchingNextPage: false,
refetch: () => {},
fetchNextPage: () => {}
}),
ALBUM_PAGE_SIZE: 50
}));
vi.mock('#lib/api/client.js', () => apiClientMock());
import Page from './+page.svelte';
import { setUser } from '#lib/auth/user.svelte.js';
import type { User } from '#lib/api/client.js';
afterEach(() => {
cleanup();
setUser(null);
});
// Library folders are server config, not a setting (#5604): the empty
// library no longer sends anyone to Settings.
describe('/library/albums with an empty library', () => {
test('an admin is sent to Admin to run a scan', () => {
setUser({ id: 'u1', username: 'root', is_admin: true } as User);
render(Page);
expect(screen.getByRole('link', { name: /run a scan/i }).getAttribute('href')).toBe('/admin');
expect(screen.queryByRole('link', { name: /open settings/i })).toBeNull();
});
test('anyone else is told the admin scans the library, with no link', () => {
setUser({ id: 'u2', username: 'alice', is_admin: false } as User);
render(Page);
expect(screen.getByText(/your server's admin has scanned the library/i)).toBeInTheDocument();
expect(screen.queryByRole('link')).toBeNull();
});
});
+24 -13
View File
@@ -7,6 +7,7 @@
import ListContinuation from '#lib/components/ListContinuation.svelte';
import QuickFilter from '#lib/components/QuickFilter.svelte';
import EmptyState from '#lib/components/EmptyState.svelte';
import { user } from '#lib/auth/user.svelte.js';
import { useDelayed } from '#lib/utils/useDelayed.svelte.js';
import type { ArtistRef } from '#lib/api/types.js';
@@ -46,19 +47,29 @@
{:else if showSkeleton.value && artists.length === 0}
<p class="text-text-secondary">Loading…</p>
{:else if !query.isPending && total === 0}
<EmptyState
title="No artists yet"
hint="Once a library folder has been scanned, artists will appear here."
>
{#snippet actions()}
<a
href="/settings"
class="inline-flex items-center rounded-md bg-action-secondary px-4 py-2 text-sm text-action-fg hover:opacity-90"
>
Open settings
</a>
{/snippet}
</EmptyState>
<!-- Library folders are server config (library.scan_paths), not a
setting, so only an admin can act: they run a scan from Admin.
Everyone else is told whose job it is (#5604). -->
{#if user.value?.is_admin}
<EmptyState
title="No artists yet"
hint="Library folders are set in the server's config. Once they're scanned, artists appear here."
>
{#snippet actions()}
<a
href="/admin"
class="inline-flex items-center rounded-md bg-action-secondary px-4 py-2 text-sm text-action-fg hover:opacity-90"
>
Run a scan
</a>
{/snippet}
</EmptyState>
{:else}
<EmptyState
title="No artists yet"
hint="Once your server's admin has scanned the library, artists appear here."
/>
{/if}
{:else if filter.trim() && filtered.length === 0}
<p class="text-text-secondary">
No artists in your loaded library match