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? Year { get; set; }
public string? Genre { get; set; }
public string? CoverArtUrl { get; set; }
///
/// 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; }
}