export interface MetadataRefreshJob {
  trackId: string;
  refreshType: 'full' | 'partial';
}

export interface AudioAnalysisJob {
  trackId: string;
  features: string[];
}

export interface CleanupJob {
  reason: 'expired' | 'manual';
  targetFiles: string[];
}

export interface LibraryScanJob {
  directory: string;
}

// Periodic integrity sweep. No payload fields required; the worker reads
// MUSIC_DIR from env. Kept as an object for forward-compatibility.
export interface IntegritySweepJob {
  // Reserved for future scoping options (e.g. specific track ids).
  reason?: 'scheduled' | 'manual';
}

// Refresh Last.fm similar-artist data for a single artist (feeds Vibe discovery).
export interface ArtistSimilarityJob {
  artistId: string;
}

// Fetch/refresh a single artist's image via the fallback chain. Decoupled from
// track enrichment so image lookups don't run inline while processing tracks.
export interface ArtistImageJob {
  artistId: string;
}

// Fetch/refresh a single album's cover art (Discogs + Cover Art Archive).
// Decoupled from track enrichment for the same reason.
export interface AlbumCoverJob {
  albumId: string;
}

// Re-process all artists through the new identity pipeline.
// Useful after schema migrations or when identity logic changes.
export interface ReprocessArtistsJob {
  batchSize?: number;
  offset?: number;
}

export type JobPayload =
  | MetadataRefreshJob
  | ArtistSimilarityJob
  | ArtistImageJob
  | AlbumCoverJob
  | AudioAnalysisJob
  | CleanupJob
  | LibraryScanJob
  | IntegritySweepJob
  | ReprocessArtistsJob;
