feat: Minstrel stops acquiring music and drops Discover
release / go (push) Successful in 1m54s
release / web (push) Failing after 5s
release / integration (push) Failing after 3m44s
release / govulncheck (push) Successful in 20s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 19s
release / android (push) Canceled after 2m37s

Minstrel is now a viewer of the library it is pointed at. Finding,
downloading and filing music moves out of it.

Removed from the server:
- the request flow (requests, approval, auto-approve) and the wanted list,
  follows, release profiles and release blocks;
- searching indexers, the download clients, the importer, the album
  lifecycle and missing-file re-acquisition;
- the catalogue's discography, search and art (the MusicBrainz release and
  track-list cache stays, for the duplicate resolver);
- Discover: its suggestions of artists not in the library, snoozes, the
  candidate-artist tag enrichment and its tuning scope;
- writes to acquisition tables from moving the library folder and from
  merging duplicates, the want-list join on Suspect sources, the sealing of
  acquisition credentials, and the release-group lookup only
  re-acquisition used.

Settling a wrong-slot duplicate no longer sets the release aside: the
copies go and their slots show as missing until a good copy is in the
library.

Removed from the web: Admin > Acquisition and Requests, /requests,
/discover, Follow on the artist page, the auto-approve toggle, and the
Collection's wanted-list tabs. The Collection is now the library's health:
an overview, Reports, Duplicates, Suspect sources and Missing files. The
README and docs no longer describe getting music.

The tables stay for now; a later migration drops them. The request
notification kinds and the Android screens are still to go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 20:51:14 -05:00
co-authored by Claude Opus 5.5
parent dabe1e052d
commit 55c7497ca7
277 changed files with 521 additions and 40021 deletions
+1 -162
View File
@@ -16,8 +16,6 @@ import type {
AdminStatus,
AdminSummary,
QuarantineActionRow,
MusicRequest,
RequestStatus,
PlaybackErrorResolution
} from './types';
@@ -38,7 +36,7 @@ export function createAdminSummaryQuery() {
});
}
// Admin status: who is listening, downloads, the library and disk,
// Admin status: who is listening, the library and disk,
// and the server, for the Overview below its verdict. Polled while open.
export async function getAdminStatus(): Promise<AdminStatus> {
@@ -53,59 +51,6 @@ export function createAdminStatusQuery() {
});
}
// Admin request queue -----------------------------------------------------
export async function listAdminRequests(
status?: RequestStatus,
limit?: number
): Promise<MusicRequest[]> {
const params = new URLSearchParams();
if (status) params.set('status', status);
if (limit !== undefined) params.set('limit', String(limit));
const qs = params.toString();
return api.get<MusicRequest[]>(
qs ? `/api/admin/requests?${qs}` : '/api/admin/requests'
);
}
// Approving puts the request on the wanted list. An artist
// request is followed on profileId, or the default profile when omitted.
export async function approveRequest(id: string, profileId?: string): Promise<MusicRequest> {
return api.post<MusicRequest>(
`/api/admin/requests/${id}/approve`,
profileId ? { profile_id: profileId } : {}
);
}
export async function rejectRequest(
id: string,
notes?: string
): Promise<MusicRequest> {
const body = notes !== undefined ? { notes } : {};
return api.post<MusicRequest>(`/api/admin/requests/${id}/reject`, body);
}
// Query factories ---------------------------------------------------------
export function createAdminRequestsQuery(status?: RequestStatus) {
return createQuery({
queryKey: qk.adminRequests(status),
queryFn: () => listAdminRequests(status),
// Only the 'approved' tab needs polling — that's where in-flight
// ingests live. Other tabs (pending/rejected/completed) are static
// until an admin acts on them.
refetchInterval: (query) => {
if (status !== 'approved') return false;
const rows = query.state.data as MusicRequest[] | undefined;
return hasInFlightRequest(rows) ? 12_000 : false;
}
});
}
function hasInFlightRequest(rows: readonly MusicRequest[] | undefined): boolean {
return rows?.some((r) => r.status === 'approved') ?? false;
}
// Admin quarantine --------------------------------------------------------
export async function listAdminQuarantine(): Promise<AdminQuarantineRow[]> {
@@ -594,7 +539,6 @@ export type AdminUser = {
username: string;
display_name: string | null;
is_admin: boolean;
auto_approve_requests: boolean;
debug_mode_enabled: boolean;
created_at: string;
};
@@ -652,10 +596,6 @@ export async function resetUserPassword(id: string, password: string): Promise<v
await api.post(`/api/admin/users/${id}/reset-password`, { password });
}
export async function updateUserAutoApprove(id: string, autoApprove: boolean): Promise<AdminUser> {
return api.put<AdminUser>(`/api/admin/users/${id}/auto-approve`, { auto_approve: autoApprove });
}
// Flip an account's diagnostics/debug-reporting opt-in. Admin-set;
// the client obeys it (with a local per-device OFF switch).
export async function updateUserDebugMode(id: string, enabled: boolean): Promise<AdminUser> {
@@ -970,28 +910,6 @@ export async function setSuspectVerdict(trackId: string, verdict: SuspectVerdict
await api.put(`/api/admin/library/suspect-sources/${encodeURIComponent(trackId)}`, { verdict });
}
// Missing-file re-acquisition ----------------------
export type ReacquisitionSettings = {
enabled: boolean;
grace_hours: number;
max_per_pass: number;
// Albums with missing files that can never be wanted automatically because
// neither they nor their artist carries an MBID. Read-only; the server
// computes it, and the card states it so the gap isn't a mystery.
unnameable_albums: number;
};
export async function getReacquisitionSettings(): Promise<ReacquisitionSettings> {
return api.get<ReacquisitionSettings>('/api/admin/library/reacquisition');
}
export async function updateReacquisitionSettings(
s: ReacquisitionSettings
): Promise<ReacquisitionSettings> {
return api.put<ReacquisitionSettings>('/api/admin/library/reacquisition', s);
}
// Notification emails: when the grouped emails go out.
export type NotificationEmailSettings = {
summary_hour: number;
@@ -1008,85 +926,6 @@ export async function updateNotificationEmailSettings(
return api.put<NotificationEmailSettings>('/api/admin/notification-email', s);
}
// Indexers and download clients -------------------------------
export type AcquisitionProtocol = 'prowlarr' | 'torznab' | 'qbittorrent' | 'exchange';
/** One indexer or download client. Secrets never come back, only whether set. */
export type AcquisitionService = {
code: string;
kind: 'search' | 'download';
protocol: AcquisitionProtocol;
label: string;
enabled: boolean;
base_url: string;
has_api_key: boolean;
has_password: boolean;
username: string;
category: string;
timeout_ms: number;
/** The three switches mean something on an exchange row only. */
serves_search: boolean;
serves_downloads: boolean;
serves_enrichment: boolean;
local_path: string;
remote_path: string;
searches_per_hour: number;
/** Switched on and addressed. */
usable: boolean;
};
export type AcquisitionUpdate = Omit<
AcquisitionService,
'code' | 'kind' | 'protocol' | 'has_api_key' | 'has_password' | 'usable'
>;
export type AcquisitionTestResult = { ok: boolean; detail: string };
const acquisitionBase = '/api/admin/acquisition/services';
export async function listAcquisitionServices(): Promise<AcquisitionService[]> {
const res = await api.get<{ services: AcquisitionService[] }>(acquisitionBase);
return res.services;
}
export async function addAcquisitionService(
protocol: AcquisitionProtocol
): Promise<AcquisitionService> {
return api.post<AcquisitionService>(acquisitionBase, { protocol });
}
export async function updateAcquisitionService(
code: string,
u: AcquisitionUpdate
): Promise<AcquisitionService> {
return api.put<AcquisitionService>(`${acquisitionBase}/${encodeURIComponent(code)}`, u);
}
export async function removeAcquisitionService(code: string): Promise<void> {
await api.del(`${acquisitionBase}/${encodeURIComponent(code)}`);
}
export async function testAcquisitionService(code: string): Promise<AcquisitionTestResult> {
return api.post<AcquisitionTestResult>(`${acquisitionBase}/${encodeURIComponent(code)}/test`, {});
}
/** Stores a key or password. Write-only: nothing comes back. */
export async function setAcquisitionSecret(
code: string,
which: 'api-key' | 'password',
value: string
): Promise<void> {
await api.put(`${acquisitionBase}/${encodeURIComponent(code)}/${which}`, { value });
}
export async function clearAcquisitionSecret(
code: string,
which: 'api-key' | 'password'
): Promise<void> {
await api.del(`${acquisitionBase}/${encodeURIComponent(code)}/${which}`);
}
// The server's own backup ---------------------------------------------------
export type BackupDestination = 'folder' | 's3';