export interface AudioAsset { id: string; size: number; chunkSize: number; chunks: number; checksum: string; wrappedKey: string; mime: string; version: 1; } export interface Track { id: string; title: string; artist_name: string; album_title: string; genre: string; duration_ms: number; owner_id: string | null; visibility: 'private' | 'public'; created_at: string; source: 'upload' | 'local' | 'catalog' | 'download' | 'huggingface'; status: 'ready' | 'missing'; asset?: AudioAsset; artwork?: string; artwork_mime?: string; has_artwork?: boolean; folder?: string; source_id?: string; remote_url?: string; legacy_masked?: boolean; remote?: { repo: string; path: string; revision: string; size: number; mime: string; masked?: boolean; objectId?: string; }; metadata_version?: number; metadata_updated_at?: string; metadata_edited_fields?: string[]; metadata_error?: string; metadata_attempts?: number; metadata_retry_at?: number; details?: Record; lyrics?: { language?: string; text: string; lines: { text: string; timestamp?: number }[]; }[]; } export interface Upload { id: string; owner_id: string; filename: string; size: number; offset: number; folder: string; status: 'receiving' | 'processing' | 'ready' | 'failed' | 'cancelled'; created_at: string; updated_at: string; error?: string; track_id?: string; duplicate?: boolean; } export interface ListeningEvent { id: string; owner_id: string; track_id: string; listened_ms: number; position_ms: number; ended: boolean; skipped: boolean; autoplay: boolean; created_at: string; updated_at: string; } export interface ReplicationJob { id: string; asset_id: string; track_id: string; status: 'pending' | 'running' | 'replicated' | 'failed'; attempts: number; next_at: number; copies: { provider: 's3' | 'huggingface'; key: string }[]; errors: Record; updated_at: string; } export const now = () => new Date().toISOString();