feat: the admin settings cards read as menus: each a titled group of rows with one short line, status first, failures in words (M503 #5607)
release / govulncheck (push) Successful in 16s
release / web (push) Failing after 1m27s
release / go (push) Successful in 1m44s
release / android (push) Successful in 5m13s
release / integration (push) Successful in 5m18s
release / Build signed APK (releases and dev) (push) Successful in 5m26s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Skipped
release / Verify release artifacts (tag releases only) (push) Skipped

Indexers and clients, searching, missing files, Lidarr's neighbours, AcoustID, fingerprinting, loudness, outgoing email's schedule, public address and proxies move from paragraph cards to SettingsGroup and SettingRow. Switches are role="switch". Also fixes the two type errors run 9023 found: the Lidarr test result is narrowed before its lists are read, and the tag-source save mock carries version_bumped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 11:25:46 -04:00
co-authored by Claude Opus 5.5
parent 7e1cfb8d08
commit 7f913e3e70
16 changed files with 449 additions and 916 deletions
+97 -147
View File
@@ -6,6 +6,8 @@
import { pushToast } from '#lib/stores/toast.svelte.js';
import { relativeTime } from '#lib/utils/relativeTime.js';
import type { SearchSettings } from '#lib/api/types.js';
import SettingsGroup from '#lib/components/settings/SettingsGroup.svelte';
import SettingRow from '#lib/components/settings/SettingRow.svelte';
// Searching and grabbing (M502 #5521): how often each want is searched
// for, whether the best release is taken without asking, and which
@@ -16,6 +18,9 @@
// is given up after the hours below (#5523).
const client = useQueryClient();
const button =
'rounded-md border border-border px-3 py-1.5 text-sm text-text-secondary hover:bg-surface-hover hover:text-text-primary disabled:opacity-50';
const field = 'w-20 rounded-md border border-border bg-background px-2 py-1.5 text-sm';
const store = createSearchSettingsQuery();
const query = $derived($store);
@@ -99,170 +104,115 @@
}
</script>
<section class="space-y-4 rounded-xl border border-border bg-surface p-5" data-testid="search-settings-card">
<div>
<h3 class="font-display text-lg font-medium text-text-primary">Searching and grabbing</h3>
<p class="mt-1 text-sm text-text-secondary">
Minstrel searches your indexers for each album on the
<a href="/collection/wanted" class="text-accent-fg hover:underline">wanted list</a>, judges every
release it finds, and hands the best one to your download client. Each album's releases and
the reason for every verdict are on the Wanted page.
</p>
</div>
<SettingsGroup title="Searching" id="searching" hint="Each wanted album is searched for, judged, and the best release downloaded.">
{#if query.isPending}
<p class="text-sm text-text-secondary">Loading…</p>
<p class="px-4 py-3 text-sm text-text-secondary">Loading…</p>
{:else if query.isError || !form || !query.data}
<p class="text-sm text-action-destructive">Couldn't load the search settings.</p>
<p class="px-4 py-3 text-sm text-error-fg">
Couldn't load the search settings.
<button type="button" class="underline hover:no-underline" onclick={() => query.refetch()}>Try again</button>
</p>
{:else}
<label class="flex items-start gap-3">
{@const data = query.data}
<SettingRow label="Last pass">
{#snippet hint()}<span data-testid="last-pass">{lastPass(data)}</span>{/snippet}
<a href="/collection/wanted" class="text-sm text-accent-fg hover:underline">Wanted</a>
</SettingRow>
<SettingRow label="Take the best release without asking" for="search-auto" hint="Off, you choose from the Wanted page.">
<input
id="search-auto"
type="checkbox"
role="switch"
aria-checked={form.auto_grab}
checked={form.auto_grab}
onchange={(e) => edit({ auto_grab: e.currentTarget.checked })}
class="mt-1"
class="h-4 w-4 cursor-pointer accent-accent"
/>
<span>
<span class="text-sm text-text-primary">Take the best release without asking</span>
<span class="block text-xs text-text-secondary">
Off, a search only lists what it found, and you choose from the Wanted page.
</span>
</span>
</label>
<label class="block">
<span class="text-sm text-text-primary">Search each album again after</span>
<span class="block text-xs text-text-secondary">
Hours between searches for an album still wanted. 0 switches the schedule off; Search on the
Wanted page still works.
</span>
<span class="mt-1 flex items-center gap-2">
<input
type="number"
min="0"
max="720"
value={form.search_interval_hours}
oninput={(e) => edit({ search_interval_hours: Number(e.currentTarget.value) })}
class="w-24 rounded border border-border bg-background px-2 py-1 text-sm text-text-primary
focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-accent"
/>
<span class="text-sm text-text-secondary">hours</span>
</span>
</label>
<fieldset>
<legend class="text-sm text-text-primary">Qualities to take</legend>
<span class="block text-xs text-text-secondary">
The best of these is taken first. A release that names no format has its file list read to
find out.
</span>
<div class="mt-2 space-y-1.5">
{#each query.data.tiers as t (t.tier)}
<label class="flex items-start gap-2">
<input type="checkbox" checked={form.allowed.includes(t.tier)} onchange={() => toggle(t.tier)} class="mt-0.5" />
<span class="text-sm text-text-primary">
{t.label}
<span class="block text-xs text-text-secondary">{t.what}</span>
</span>
</label>
{/each}
</SettingRow>
<SettingRow label="Search again after" for="search-interval" hint="For an album still wanted. 0 turns the schedule off.">
<input
id="search-interval"
type="number"
min="0"
max="720"
value={form.search_interval_hours}
oninput={(e) => edit({ search_interval_hours: Number(e.currentTarget.value) })}
class={field}
/>
<span class="text-sm text-text-secondary">hours</span>
</SettingRow>
<SettingRow label="Qualities to take" hint="The best of these is taken first." />
{#each data.tiers as t (t.tier)}
<div class="pl-4">
<SettingRow label={t.label} for="tier-{t.tier}" hint={t.what}>
<input
id="tier-{t.tier}"
type="checkbox"
checked={form.allowed.includes(t.tier)}
onchange={() => toggle(t.tier)}
class="h-4 w-4 cursor-pointer accent-accent"
/>
</SettingRow>
</div>
</fieldset>
{#if query.data.scan_paths.length > 1}
<label class="block">
<span class="text-sm text-text-primary">File new music into</span>
<span class="block text-xs text-text-secondary">
A download that checks out is copied here as Artist/Album (Year)/Artist - Album - NN -
Title, tagged with its MusicBrainz ids.
</span>
{/each}
{#if data.scan_paths.length > 1}
<SettingRow label="File new music into" for="search-root" hint="As Artist/Album (Year), tagged with its MusicBrainz ids.">
<select
value={form.import_root || query.data.scan_paths[0]}
id="search-root"
value={form.import_root || data.scan_paths[0]}
onchange={(e) => edit({ import_root: e.currentTarget.value })}
class="mt-1 rounded border border-border bg-background px-2 py-1 text-sm text-text-primary
focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-accent"
class="rounded-md border border-border bg-background px-2 py-1.5 font-mono text-sm"
>
{#each query.data.scan_paths as p (p)}
{#each data.scan_paths as p (p)}
<option value={p}>{p}</option>
{/each}
</select>
</label>
{:else if query.data.scan_paths.length === 1}
<p class="text-xs text-text-secondary">
A download that checks out is copied into <span class="font-mono">{query.data.scan_paths[0]}</span>
as Artist/Album (Year)/Artist - Album - NN - Title, tagged with its MusicBrainz ids.
</p>
</SettingRow>
{:else if data.scan_paths.length === 1}
<SettingRow label="New music goes into" hint="As Artist/Album (Year), tagged with its MusicBrainz ids.">
<span class="font-mono text-sm text-text-secondary">{data.scan_paths[0]}</span>
</SettingRow>
{/if}
<fieldset class="space-y-3">
<legend class="text-sm text-text-primary">After the download</legend>
<label class="block">
<span class="block text-xs text-text-secondary">
The files are copied into the library, so the download goes on sharing until either limit,
then is removed with its files. A ratio of 0 removes it once imported; 0 days is no time
limit.
</span>
<span class="mt-1 flex flex-wrap items-center gap-2 text-sm text-text-secondary">
Seed to a ratio of
<input
type="number"
min="0"
max="100"
step="0.1"
aria-label="Seed ratio"
value={form.seed_ratio}
oninput={(e) => edit({ seed_ratio: Number(e.currentTarget.value) })}
class="w-20 rounded border border-border bg-background px-2 py-1 text-sm text-text-primary
focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-accent"
/>
or for
<input
type="number"
min="0"
max="365"
aria-label="Seed days"
value={form.seed_days}
oninput={(e) => edit({ seed_days: Number(e.currentTarget.value) })}
class="w-20 rounded border border-border bg-background px-2 py-1 text-sm text-text-primary
focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-accent"
/>
days
</span>
</label>
<label class="block">
<span class="block text-xs text-text-secondary">
A download nobody is sharing is asked for again three times, ten minutes apart, then given
up: removed, held back for a week, and the album searched for again. 0 never gives up for
that; a download the client fails is always given up.
</span>
<span class="mt-1 flex flex-wrap items-center gap-2 text-sm text-text-secondary">
Give up on a stalled download after
<input
type="number"
min="0"
max="720"
aria-label="Stall hours"
value={form.stall_hours}
oninput={(e) => edit({ stall_hours: Number(e.currentTarget.value) })}
class="w-20 rounded border border-border bg-background px-2 py-1 text-sm text-text-primary
focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-accent"
/>
hours
</span>
</label>
</fieldset>
<p class="text-xs text-text-secondary" data-testid="last-pass">{lastPass(query.data)}</p>
<div class="flex justify-end">
<button
type="button"
onclick={save}
disabled={!dirty || saving || form.allowed.length === 0}
class="rounded-md bg-action-secondary px-4 py-2 text-sm text-action-fg hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50"
>
<SettingRow label="Seed ratio" for="seed-ratio" hint="Share a finished download to this ratio. 0 stops once it's filed.">
<input
id="seed-ratio"
type="number"
min="0"
max="100"
step="0.1"
value={form.seed_ratio}
oninput={(e) => edit({ seed_ratio: Number(e.currentTarget.value) })}
class={field}
/>
</SettingRow>
<SettingRow label="Seed days" for="seed-days" hint="Or for this long, whichever comes first. 0 is no limit.">
<input
id="seed-days"
type="number"
min="0"
max="365"
value={form.seed_days}
oninput={(e) => edit({ seed_days: Number(e.currentTarget.value) })}
class={field}
/>
<span class="text-sm text-text-secondary">days</span>
</SettingRow>
<SettingRow label="Give up on a stalled download after" for="stall-hours" hint="When nobody shares it. 0 never gives up.">
<input
id="stall-hours"
type="number"
min="0"
max="720"
value={form.stall_hours}
oninput={(e) => edit({ stall_hours: Number(e.currentTarget.value) })}
class={field}
/>
<span class="text-sm text-text-secondary">hours</span>
</SettingRow>
<div class="flex justify-end px-4 py-3">
<button type="button" class={button} onclick={save} disabled={!dirty || saving || form.allowed.length === 0}>
{saving ? 'Saving…' : 'Save'}
</button>
</div>
{/if}
</section>
</SettingsGroup>