38 lines
900 B
C#
38 lines
900 B
C#
using System;
|
|
|
|
namespace StreamPlayer.Desktop.Models;
|
|
|
|
public sealed record LiveEvent(
|
|
string Title,
|
|
string DisplayTime,
|
|
string Category,
|
|
string Status,
|
|
string PageUrl,
|
|
string ChannelName,
|
|
long StartTimestamp)
|
|
{
|
|
public bool IsLive =>
|
|
!string.IsNullOrWhiteSpace(Status) &&
|
|
Status.Contains("live", StringComparison.OrdinalIgnoreCase);
|
|
|
|
public string Subtitle
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrWhiteSpace(DisplayTime) && string.IsNullOrWhiteSpace(Category))
|
|
{
|
|
return string.Empty;
|
|
}
|
|
if (string.IsNullOrWhiteSpace(Category))
|
|
{
|
|
return DisplayTime;
|
|
}
|
|
if (string.IsNullOrWhiteSpace(DisplayTime))
|
|
{
|
|
return Category;
|
|
}
|
|
return $"{DisplayTime} · {Category}";
|
|
}
|
|
}
|
|
}
|