namespace octo_fiesta.Models;
///
/// Represents a song (local or external)
///
public class Song
{
///
/// Unique ID. For external songs, prefixed with "ext-" + provider + "-" + external id
/// Example: "ext-deezer-123456" or "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; } // In seconds
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; }
///
/// High-resolution cover art URL (for embedding)
///
public string? CoverArtUrlLarge { get; set; }
///
/// BPM (beats per minute) if available
///
public int? Bpm { get; set; }
///
/// ISRC (International Standard Recording Code)
///
public string? Isrc { get; set; }
///
/// Full release date (format: YYYY-MM-DD)
///
public string? ReleaseDate { get; set; }
///
/// Album artist name (may differ from track artist)
///
public string? AlbumArtist { get; set; }
///
/// Composer(s)
///
public string? Composer { get; set; }
///
/// Album label
///
public string? Label { get; set; }
///
/// Copyright
///
public string? Copyright { get; set; }
///
/// Contributing artists (features, etc.)
///
public List Contributors { get; set; } = new();
///
/// Indicates whether the song is available locally or needs to be downloaded
///
public bool IsLocal { get; set; }
///
/// External provider (deezer, spotify, etc.) - null if local
///
public string? ExternalProvider { get; set; }
///
/// ID on the external provider (for downloading)
///
public string? ExternalId { get; set; }
///
/// Local file path (if available)
///
public string? LocalPath { get; set; }
///
/// Deezer explicit content lyrics value
/// 0 = Naturally clean, 1 = Explicit, 2 = Not applicable, 3 = Clean/edited version, 6/7 = Unknown
///
public int? ExplicitContentLyrics { get; set; }
}
///
/// Represents an artist
///
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; }
}
///
/// Represents an 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();
}
///
/// Search result combining local and external results
///
public class SearchResult
{
public List Songs { get; set; } = new();
public List Albums { get; set; } = new();
public List Artists { get; set; } = new();
}
///
/// Download status of a song
///
public enum DownloadStatus
{
NotStarted,
InProgress,
Completed,
Failed
}
///
/// Information about an ongoing or completed download
///
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 to 1.0
public string? LocalPath { get; set; }
public string? ErrorMessage { get; set; }
public DateTime StartedAt { get; set; }
public DateTime? CompletedAt { get; set; }
}
///
/// Subsonic library scan status
///
public class ScanStatus
{
public bool Scanning { get; set; }
public int? Count { get; set; }
}