KaraokePC/Herse.Models/Song.cs
mbrucedogs d087d2d393 fixed bug
Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
2025-07-22 07:56:22 -05:00

59 lines
1.4 KiB
C#

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("path")]
public string Path { get; set; }
// [JsonProperty("guid")]
// public string Guid { 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");
}
}
}
}
public class History : Song
{
[JsonProperty("count")]
public int Count { get; set; }
}
}