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
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:
@@ -10,6 +10,8 @@
|
||||
} from '#lib/api/admin.js';
|
||||
import { errMessage } from '#lib/api/errors.js';
|
||||
import { pushToast } from '#lib/stores/toast.svelte.js';
|
||||
import SettingsGroup from '#lib/components/settings/SettingsGroup.svelte';
|
||||
import SettingRow from '#lib/components/settings/SettingRow.svelte';
|
||||
|
||||
// AcoustID recording-id lookup (M401): fills the MusicBrainz ids that
|
||||
// untagged tracks lack, so the similarity arms can see them. Off until the
|
||||
@@ -122,194 +124,93 @@
|
||||
}
|
||||
}
|
||||
|
||||
const rowClass = 'flex items-center justify-between gap-4 py-2';
|
||||
const inputClass =
|
||||
'rounded-md border border-border bg-background px-3 py-1.5 text-sm text-text-primary ' +
|
||||
'placeholder:text-text-muted focus:outline-hidden focus:ring-2 focus:ring-accent';
|
||||
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 = 'rounded-md border border-border bg-background px-3 py-1.5 text-sm';
|
||||
</script>
|
||||
|
||||
<section class="space-y-4 rounded-xl border border-border bg-surface p-5" data-testid="acoustid-card">
|
||||
<div class="flex items-center justify-between gap-4">
|
||||
<div>
|
||||
<h3 class="font-display text-lg font-medium text-text-primary">AcoustID</h3>
|
||||
<p class="mt-1 text-sm text-text-secondary">
|
||||
Finds MusicBrainz ids for untagged tracks, so Songs-like and radio can place them.
|
||||
</p>
|
||||
</div>
|
||||
{#if overview}
|
||||
{#if overview.ready && !overview.status.problem}
|
||||
<span
|
||||
class="inline-flex shrink-0 items-center gap-2 rounded-md bg-accent-tint px-3 py-1 text-xs font-medium text-action-primary"
|
||||
>
|
||||
<span class="h-1.5 w-1.5 rounded-full bg-action-primary"></span>
|
||||
{overview.status.running ? 'Looking up' : 'On'}
|
||||
</span>
|
||||
{:else}
|
||||
<span
|
||||
class="inline-flex shrink-0 items-center gap-2 rounded-md border border-border px-3 py-1 text-xs text-text-muted"
|
||||
data-testid="acoustid-state"
|
||||
>
|
||||
<span class="h-1.5 w-1.5 rounded-full bg-text-muted"></span>
|
||||
{#if overview.ready}Needs attention{:else if !overview.settings.api_key_set}Needs a key{:else}Off{/if}
|
||||
</span>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<SettingsGroup title="AcoustID" id="acoustid" hint="Names untagged tracks from their sound, so radio and Songs-like can place them.">
|
||||
{#if loadError}
|
||||
<p class="text-sm text-action-destructive">
|
||||
<p class="px-4 py-3 text-sm text-error-fg">
|
||||
Couldn't load AcoustID settings.
|
||||
<button type="button" class="underline hover:no-underline" onclick={load}>Try again</button>
|
||||
</p>
|
||||
{:else if overview === null}
|
||||
<p class="text-sm text-text-secondary">Loading AcoustID settings…</p>
|
||||
<p class="px-4 py-3 text-sm text-text-secondary">Loading AcoustID settings…</p>
|
||||
{:else}
|
||||
<SettingRow label="Status">
|
||||
{#if overview.ready && !overview.status.problem}
|
||||
<span class="text-sm text-text-secondary">{overview.status.running ? 'Looking up' : 'On'}</span>
|
||||
{:else}
|
||||
<span class="text-sm text-text-secondary" data-testid="acoustid-state">
|
||||
{#if overview.ready}Needs attention{:else if !overview.settings.api_key_set}Needs a key{:else}Off{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</SettingRow>
|
||||
{#if overview.status.problem}
|
||||
<p class="text-sm text-action-destructive" data-testid="acoustid-problem">
|
||||
{overview.status.problem}
|
||||
</p>
|
||||
<p class="px-4 py-3 text-sm text-error-fg" data-testid="acoustid-problem">{overview.status.problem}</p>
|
||||
{/if}
|
||||
|
||||
<div class="divide-y divide-border">
|
||||
<label class={rowClass}>
|
||||
<span>
|
||||
<span class="block text-sm text-text-primary">Look up untagged tracks</span>
|
||||
<span class="block text-xs text-text-secondary">Sends audio fingerprints to AcoustID.</span>
|
||||
</span>
|
||||
<input type="checkbox" bind:checked={enabled} />
|
||||
</label>
|
||||
|
||||
<div class={rowClass}>
|
||||
<label for="acoustid-key">
|
||||
<span class="block text-sm text-text-primary">API key</span>
|
||||
<span class="block text-xs text-text-secondary">
|
||||
Free for non-commercial use.
|
||||
<a
|
||||
href="https://acoustid.org/new-application"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="underline hover:no-underline">Register an application</a
|
||||
>
|
||||
</span>
|
||||
</label>
|
||||
<div class="flex items-center gap-2">
|
||||
<input
|
||||
id="acoustid-key"
|
||||
type="password"
|
||||
autocomplete="off"
|
||||
bind:value={keyInput}
|
||||
placeholder={overview.settings.api_key_set ? 'Stored' : 'Paste key'}
|
||||
class="{inputClass} w-40 font-mono"
|
||||
/>
|
||||
{#if overview.settings.api_key_set}
|
||||
<button
|
||||
type="button"
|
||||
class="text-xs text-text-secondary underline hover:no-underline"
|
||||
disabled={saving}
|
||||
onclick={forgetKey}>Remove</button
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class={rowClass}>
|
||||
<span>
|
||||
<span class="block text-sm text-text-primary">Minimum score</span>
|
||||
<span class="block text-xs text-text-secondary">How sure AcoustID must be, 0.5 to 1.</span>
|
||||
</span>
|
||||
<input
|
||||
type="number"
|
||||
min="0.5"
|
||||
max="1"
|
||||
step="0.01"
|
||||
bind:value={minScore}
|
||||
class="{inputClass} w-24 text-right"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{#if !scoreOk}
|
||||
<p class="text-xs text-action-destructive" data-testid="acoustid-problems">
|
||||
Minimum score must be from 0.5 to 1.
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-md bg-action-secondary px-4 py-2 text-sm text-action-fg hover:opacity-90
|
||||
focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-accent
|
||||
disabled:cursor-not-allowed disabled:opacity-50"
|
||||
disabled={!dirty || saving || !scoreOk}
|
||||
onclick={save}
|
||||
>
|
||||
<SettingRow label="Look up untagged tracks" for="acoustid-enabled" hint="Sends audio fingerprints to AcoustID.">
|
||||
<input id="acoustid-enabled" type="checkbox" role="switch" aria-checked={enabled} bind:checked={enabled} class="h-4 w-4 cursor-pointer accent-accent" />
|
||||
</SettingRow>
|
||||
<SettingRow label="API key" for="acoustid-key">
|
||||
{#snippet hint()}
|
||||
Free for non-commercial use.
|
||||
<a href="https://acoustid.org/new-application" target="_blank" rel="noopener noreferrer" class="underline hover:no-underline"
|
||||
>Register an application</a
|
||||
>
|
||||
{/snippet}
|
||||
<input
|
||||
id="acoustid-key"
|
||||
type="password"
|
||||
autocomplete="off"
|
||||
bind:value={keyInput}
|
||||
placeholder={overview.settings.api_key_set ? 'Key saved' : 'Paste key'}
|
||||
class="{field} w-40 font-mono"
|
||||
/>
|
||||
{#if overview.settings.api_key_set}
|
||||
<button type="button" class={button} disabled={saving} onclick={forgetKey}>Remove</button>
|
||||
{/if}
|
||||
</SettingRow>
|
||||
<SettingRow label="Minimum score" for="acoustid-score" hint="How sure AcoustID must be, 0.5 to 1.">
|
||||
<input id="acoustid-score" type="number" min="0.5" max="1" step="0.01" bind:value={minScore} class="{field} w-24" />
|
||||
</SettingRow>
|
||||
<div class="flex flex-wrap items-center justify-end gap-2 px-4 py-3">
|
||||
{#if !scoreOk}
|
||||
<p class="mr-auto text-xs text-error-fg" data-testid="acoustid-problems">Minimum score must be from 0.5 to 1.</p>
|
||||
{/if}
|
||||
<button type="button" class={button} disabled={!dirty || saving || !scoreOk} onclick={save}>
|
||||
{saving ? 'Saving…' : 'Save'}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#if overview.coverage.total > 0}
|
||||
<div class="border-t border-border pt-3" data-testid="acoustid-coverage">
|
||||
<h4 class="text-sm font-medium text-text-primary">Recording ids</h4>
|
||||
<dl class="mt-1 divide-y divide-border text-sm">
|
||||
<div class={rowClass}>
|
||||
<dt class="text-text-secondary">From tags</dt>
|
||||
<dd class="tabular-nums">{overview.coverage.from_tag.toLocaleString()}</dd>
|
||||
</div>
|
||||
<div class={rowClass}>
|
||||
<dt class="text-text-secondary">Looked up</dt>
|
||||
<dd class="tabular-nums">{overview.coverage.from_acoustid.toLocaleString()}</dd>
|
||||
</div>
|
||||
<div class={rowClass}>
|
||||
<dt class="text-text-secondary">None</dt>
|
||||
<dd class="tabular-nums">{withoutId.toLocaleString()}</dd>
|
||||
</div>
|
||||
<div class={rowClass}>
|
||||
<dt class="pl-4 text-text-secondary">Waiting to be looked up</dt>
|
||||
<dd class="tabular-nums">{overview.coverage.pending.toLocaleString()}</dd>
|
||||
</div>
|
||||
<div class={rowClass}>
|
||||
<dt class="pl-4 text-text-secondary" title="AcoustID knows no recording for these">
|
||||
No match
|
||||
</dt>
|
||||
<dd class="tabular-nums">{overview.coverage.no_match.toLocaleString()}</dd>
|
||||
</div>
|
||||
<div class={rowClass}>
|
||||
<dt
|
||||
class="pl-4 text-text-secondary"
|
||||
title="Several recordings fit and nothing told them apart, so none was written"
|
||||
>
|
||||
Ambiguous
|
||||
</dt>
|
||||
<dd class="tabular-nums">{overview.coverage.ambiguous.toLocaleString()}</dd>
|
||||
</div>
|
||||
<div class={rowClass}>
|
||||
<dt class="pl-4 text-text-secondary" title="The file couldn't be fingerprinted">
|
||||
Failed
|
||||
</dt>
|
||||
<dd class="tabular-nums">{overview.coverage.failed.toLocaleString()}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<div class="mt-2 flex justify-end">
|
||||
{@const c = overview.coverage}
|
||||
<div data-testid="acoustid-coverage">
|
||||
<SettingRow
|
||||
label="Recording ids"
|
||||
hint="{c.from_tag.toLocaleString()} from tags · {c.from_acoustid.toLocaleString()} looked up · {withoutId.toLocaleString()} none"
|
||||
/>
|
||||
<SettingRow
|
||||
label="Without one"
|
||||
hint="{c.pending.toLocaleString()} waiting · {c.no_match.toLocaleString()} no match · {c.ambiguous.toLocaleString()} ambiguous · {c.failed.toLocaleString()} failed"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-md border border-border px-4 py-2 text-sm text-text-primary hover:bg-background
|
||||
focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-accent
|
||||
disabled:cursor-not-allowed disabled:opacity-50"
|
||||
class={button}
|
||||
disabled={!overview.ready || overview.status.running || starting}
|
||||
title={overview.ready ? undefined : 'Switch the lookup on and add a key first'}
|
||||
onclick={runNow}
|
||||
>
|
||||
{overview.status.running ? 'Looking up…' : 'Look up now'}
|
||||
</button>
|
||||
</div>
|
||||
</SettingRow>
|
||||
</div>
|
||||
|
||||
{#if overview.coverage.ambiguous + overview.coverage.failed > 0}
|
||||
<details class="border-t border-border pt-3" ontoggle={toggleUnsettled}>
|
||||
{#if c.ambiguous + c.failed > 0}
|
||||
<details class="px-4 py-3" ontoggle={toggleUnsettled}>
|
||||
<summary class="cursor-pointer text-sm text-text-primary">
|
||||
Tracks the lookup couldn't settle ({(
|
||||
overview.coverage.ambiguous + overview.coverage.failed
|
||||
).toLocaleString()})
|
||||
Tracks the lookup couldn't settle ({(c.ambiguous + c.failed).toLocaleString()})
|
||||
</summary>
|
||||
{#if unsettled === null}
|
||||
<p class="mt-2 text-sm text-text-secondary">Loading tracks…</p>
|
||||
@@ -319,12 +220,10 @@
|
||||
<li class="flex items-center justify-between gap-4 py-2">
|
||||
<span class="min-w-0">
|
||||
<span class="block truncate text-text-primary">{t.title}</span>
|
||||
<span class="block truncate text-xs text-text-secondary"
|
||||
>{t.artist} · {t.album}</span
|
||||
>
|
||||
<span class="block truncate text-xs text-text-secondary">{t.artist} · {t.album}</span>
|
||||
</span>
|
||||
<span class="shrink-0 text-xs text-text-muted" title={t.detail ?? undefined}>
|
||||
{t.state === 'ambiguous' ? `${t.candidates} recordings` : 'failed'}
|
||||
{t.state === 'ambiguous' ? `${t.candidates} recordings` : "couldn't fingerprint"}
|
||||
</span>
|
||||
</li>
|
||||
{/each}
|
||||
@@ -334,4 +233,4 @@
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
</section>
|
||||
</SettingsGroup>
|
||||
|
||||
Reference in New Issue
Block a user