feat: Collection › Unmatched lists the library albums no MusicBrainz album matched, each matched by hand from a search or a link, or left off (M502 #5579)
release / govulncheck (push) Successful in 16s
release / web (push) Successful in 1m17s
release / go (push) Successful in 1m34s
release / integration (push) Failing after 5m34s
release / android (push) Successful in 5m36s
release / Build signed APK (releases and dev) (push) Successful in 5m44s
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) Successful in 1m17s
release / go (push) Successful in 1m34s
release / integration (push) Failing after 5m34s
release / android (push) Successful in 5m36s
release / Build signed APK (releases and dev) (push) Successful in 5m44s
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
Like Lidarr's Unmapped Files. A local band's album, which MusicBrainz will never have, is left off: never matched again and not counted. A re-tagged album is matched again on the next listing. The Collection's verdict now says when library albums need matching. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,8 @@ export const qk = {
|
||||
['adminWants', { state, q, artist }] as const,
|
||||
wantArtists: (q: string = '') => ['adminWants', 'artists', { q }] as const,
|
||||
wantTracks: (id: string) => ['wantTracks', id] as const,
|
||||
// The Collection's Unmatched section (#5579).
|
||||
unmatched: () => ['adminWants', 'unmatched'] as const,
|
||||
adminFollows: () => ['adminFollows'] as const,
|
||||
adminFollow: (artistMbid: string) => ['adminFollow', artistMbid] as const,
|
||||
releaseProfiles: () => ['releaseProfiles'] as const,
|
||||
|
||||
@@ -733,6 +733,9 @@ export type WantCounts = {
|
||||
activity: number;
|
||||
attention: number;
|
||||
blocked: number;
|
||||
// Library albums no MusicBrainz album matched, waiting to be matched by
|
||||
// hand or left off (#5579).
|
||||
unmatched: number;
|
||||
};
|
||||
|
||||
// What an import's check counted (#5522).
|
||||
@@ -818,9 +821,23 @@ export type ReleaseBlocksPage = { items: ReleaseBlock[]; limit: number; offset:
|
||||
// The one-time listing of the library's albums as held (#5567): when it
|
||||
// finished (null while it runs), and how many albums nothing names to
|
||||
// MusicBrainz, so they could not be listed.
|
||||
export type UnmatchedAlbum = { album_id: string; title: string; artist: string; detail: string };
|
||||
// One album in the Collection's Unmatched section (#5579): why no
|
||||
// MusicBrainz album matched it, or that a person left it off.
|
||||
export type UnmatchedAlbum = {
|
||||
album_id: string;
|
||||
title: string;
|
||||
artist: string;
|
||||
detail: string;
|
||||
tracks: number;
|
||||
left_off: boolean;
|
||||
decided_at: string;
|
||||
};
|
||||
|
||||
export type LibraryListing = { listed_at: string | null; unlisted: number; unmatched: UnmatchedAlbum[] };
|
||||
// What matching an album by hand did: the MusicBrainz album it is now, and
|
||||
// how many of its tracks agree with that album's closest edition.
|
||||
export type ManualMatch = { release_group_mbid: string; title: string; artist: string; agree: number; tracks: number };
|
||||
|
||||
export type LibraryListing = { listed_at: string | null; unlisted: number };
|
||||
|
||||
// artist heads the list when it is narrowed to one artist's page.
|
||||
export type WantsPage = Page<Want> & { counts: WantCounts; library: LibraryListing; artist?: WantArtist };
|
||||
|
||||
@@ -11,8 +11,10 @@ import type {
|
||||
ReleaseProfileInput,
|
||||
ReleaseProfilesResponse,
|
||||
GrabResult,
|
||||
ManualMatch,
|
||||
SearchResult,
|
||||
SearchSettings,
|
||||
UnmatchedAlbum,
|
||||
WantArtistsPage,
|
||||
WantState,
|
||||
WantTracks,
|
||||
@@ -92,6 +94,37 @@ export function createWantTracksQuery(id: string) {
|
||||
});
|
||||
}
|
||||
|
||||
// The Collection's Unmatched section (#5579): library albums no MusicBrainz
|
||||
// album matched, and after them the ones a person left off.
|
||||
export async function listUnmatched(): Promise<UnmatchedAlbum[]> {
|
||||
const out = await api.get<{ items: UnmatchedAlbum[] }>('/api/admin/wanted/unmatched');
|
||||
return out.items;
|
||||
}
|
||||
|
||||
export function createUnmatchedQuery() {
|
||||
return createQuery({
|
||||
queryKey: qk.unmatched(),
|
||||
queryFn: listUnmatched,
|
||||
staleTime: 30_000
|
||||
});
|
||||
}
|
||||
|
||||
// Puts an unmatched album on the list as held, as the MusicBrainz album ref
|
||||
// names: a release group's or a release's link, or a bare id.
|
||||
export async function matchUnmatched(albumId: string, ref: string): Promise<ManualMatch> {
|
||||
return api.post<ManualMatch>(`/api/admin/wanted/unmatched/${albumId}/match`, { ref });
|
||||
}
|
||||
|
||||
// Leaves an album off for good (a local band's, which MusicBrainz will
|
||||
// never have), or puts one left off back.
|
||||
export async function leaveUnmatchedOff(albumId: string): Promise<void> {
|
||||
await api.post<void>(`/api/admin/wanted/unmatched/${albumId}/leave-off`, {});
|
||||
}
|
||||
|
||||
export async function putUnmatchedBack(albumId: string): Promise<void> {
|
||||
await api.post<void>(`/api/admin/wanted/unmatched/${albumId}/put-back`, {});
|
||||
}
|
||||
|
||||
export async function removeWant(id: string): Promise<void> {
|
||||
await api.del(`/api/admin/wanted/${id}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user