using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Herse.Models { public class Song { [JsonProperty("title")] public string Title { get; set; } [JsonProperty("artist")] public string Artist { get; set; } [JsonProperty("genre")] public string Genre { get; set; } [JsonProperty("path")] public string Path { get; set; } [JsonProperty("disabled")] public bool Disabled { get; set; } = false; [JsonProperty("favorite")] public bool Favorite { get; set; } = false; [JsonIgnore] public FileType FileType { get { switch (Path.Substring(Path.Length - 3, 3).ToLower()) { case "cdg": case "mp3": return FileType.CDG; case "mp4": return FileType.MP4; case "zip": return FileType.ZIP; default: throw new Exception("file type not handled"); } } } } }