feat(library): surface metadata enrichment status, errors and covers
The mapper dropped metadata_status and hardcoded availability, so enrichment state was invisible and a just-uploaded track never appeared to change. Map metadata_status/metadata_error/has_cover onto Track; add MetadataStatusBadge (pending spinner / enriched / failed-with-reason / manual) shown in TrackRow, and serve token-bearing track covers via getTrackCoverUrl. UploadPage now polls each uploaded track (stops once enrichment settles) so the resolved title/artist — or a failure reason — appears live. i18n in en + ru. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
export type TrackAvailability = 'server' | 'downloading' | 'error' | 'missing';
|
||||
|
||||
/**
|
||||
* Metadata-enrichment state, distinct from file `availability`. `pending` = the
|
||||
* worker hasn't finished (or hasn't started); `enriched` = identity found;
|
||||
* `failed` = no match / a worker error (see `metadataError`); `manual` = user-
|
||||
* edited and never auto-overwritten.
|
||||
*/
|
||||
export type MetadataStatus = 'pending' | 'enriched' | 'failed' | 'manual';
|
||||
|
||||
export interface Track {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -8,12 +16,16 @@ export interface Track {
|
||||
albumId: string;
|
||||
albumTitle: string;
|
||||
albumArtUrl?: string;
|
||||
hasCover: boolean;
|
||||
durationMs: number;
|
||||
trackNumber?: number;
|
||||
discNumber?: number;
|
||||
year?: number;
|
||||
genre?: string;
|
||||
availability: TrackAvailability;
|
||||
metadataStatus: MetadataStatus;
|
||||
/** Human-readable reason the last enrichment run set `failed`; else undefined. */
|
||||
metadataError?: string;
|
||||
fileSize?: number;
|
||||
format?: string;
|
||||
bitrate?: number;
|
||||
|
||||
Reference in New Issue
Block a user