namespace octo_fiesta.Models; /// /// Représente une chanson (locale ou externe) /// public class Song { /// /// ID unique. Pour les chansons externes, préfixé avec "ext-" + provider + "-" + id externe /// Exemple: "ext-deezer-123456" ou "local-789" /// public string Id { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; public string Artist { get; set; } = string.Empty; public string? ArtistId { get; set; } public string Album { get; set; } = string.Empty; public string? AlbumId { get; set; } public int? Duration { get; set; } // En secondes public int? Track { get; set; } public int? DiscNumber { get; set; } public int? TotalTracks { get; set; } public int? Year { get; set; } public string? Genre { get; set; } public string? CoverArtUrl { get; set; } /// /// URL de la cover en haute résolution (pour embedding) /// public string? CoverArtUrlLarge { get; set; } /// /// BPM (beats per minute) si disponible /// public int? Bpm { get; set; } /// /// ISRC (International Standard Recording Code) /// public string? Isrc { get; set; } /// /// Date de sortie complète (format: YYYY-MM-DD) /// public string? ReleaseDate { get; set; } /// /// Nom de l'album artiste (peut différer de l'artiste du track) /// public string? AlbumArtist { get; set; } /// /// Compositeur(s) /// public string? Composer { get; set; } /// /// Label de l'album /// public string? Label { get; set; } /// /// Copyright /// public string? Copyright { get; set; } /// /// Artistes contributeurs (featurings, etc.) /// public List Contributors { get; set; } = new(); /// /// Indique si la chanson est disponible localement ou doit être téléchargée /// public bool IsLocal { get; set; } /// /// Provider externe (deezer, spotify, etc.) - null si local /// public string? ExternalProvider { get; set; } /// /// ID sur le provider externe (pour le téléchargement) /// public string? ExternalId { get; set; } /// /// Chemin du fichier local (si disponible) /// public string? LocalPath { get; set; } } /// /// Représente un artiste /// public class Artist { public string Id { get; set; } = string.Empty; public string Name { get; set; } = string.Empty; public string? ImageUrl { get; set; } public int? AlbumCount { get; set; } public bool IsLocal { get; set; } public string? ExternalProvider { get; set; } public string? ExternalId { get; set; } } /// /// Représente un album /// public class Album { public string Id { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; public string Artist { get; set; } = string.Empty; public string? ArtistId { get; set; } public int? Year { get; set; } public int? SongCount { get; set; } public string? CoverArtUrl { get; set; } public string? Genre { get; set; } public bool IsLocal { get; set; } public string? ExternalProvider { get; set; } public string? ExternalId { get; set; } public List Songs { get; set; } = new(); } /// /// Résultat de recherche combinant résultats locaux et externes /// public class SearchResult { public List Songs { get; set; } = new(); public List Albums { get; set; } = new(); public List Artists { get; set; } = new(); } /// /// État du téléchargement d'une chanson /// public enum DownloadStatus { NotStarted, InProgress, Completed, Failed } /// /// Information sur un téléchargement en cours ou terminé /// public class DownloadInfo { public string SongId { get; set; } = string.Empty; public string ExternalId { get; set; } = string.Empty; public string ExternalProvider { get; set; } = string.Empty; public DownloadStatus Status { get; set; } public double Progress { get; set; } // 0.0 à 1.0 public string? LocalPath { get; set; } public string? ErrorMessage { get; set; } public DateTime StartedAt { get; set; } public DateTime? CompletedAt { get; set; } } /// /// Statut du scan de bibliothèque Subsonic /// public class ScanStatus { public bool Scanning { get; set; } public int? Count { get; set; } }