2022-06-20 19:49:47 +02:00
|
|
|
|
using System.Text.Json.Serialization;
|
2022-06-20 21:40:42 +02:00
|
|
|
|
using SharedProject.common;
|
2022-07-05 18:52:38 +02:00
|
|
|
|
using SharedProject.enums;
|
2022-06-20 19:49:47 +02:00
|
|
|
|
|
|
|
|
|
namespace SharedProject.models;
|
2022-04-24 20:07:11 +02:00
|
|
|
|
|
|
|
|
|
public class SongPlayData
|
|
|
|
|
{
|
|
|
|
|
public string Title { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
public string Artist { get; set; } = string.Empty;
|
2022-06-20 19:49:47 +02:00
|
|
|
|
|
|
|
|
|
public int MusicId { get; set; }
|
2022-04-24 20:07:11 +02:00
|
|
|
|
|
2022-06-20 21:40:42 +02:00
|
|
|
|
public SongPlayDetailData[] SongPlaySubDataList { get; set; } = new SongPlayDetailData[SharedConstants.DIFFICULTY_COUNT];
|
2022-06-18 16:11:14 +02:00
|
|
|
|
|
|
|
|
|
public bool IsFavorite { get; set; }
|
2022-04-24 20:07:11 +02:00
|
|
|
|
|
|
|
|
|
public bool ShowDetails { get; set; }
|
2022-06-20 19:49:47 +02:00
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public int TotalPlayCount
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return SongPlaySubDataList.Sum(data => data.PlayCount);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-05 18:52:38 +02:00
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public DateTime LastPlayTime
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
var songPlayDetailData = SongPlaySubDataList.Where(data => data.ClearState != ClearState.NotPlayed)
|
|
|
|
|
.MinBy(data => data.LastPlayTime);
|
|
|
|
|
return songPlayDetailData?.LastPlayTime ?? DateTime.MaxValue;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-04-24 20:07:11 +02:00
|
|
|
|
}
|