You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Controller/Library/TVUtils.cs

48 lines
1.2 KiB

using System;
6 years ago
namespace MediaBrowser.Controller.Library
{
/// <summary>
/// Class TVUtils.
6 years ago
/// </summary>
public static class TVUtils
{
/// <summary>
/// Gets the air days.
/// </summary>
/// <param name="day">The day.</param>
/// <returns>List{DayOfWeek}.</returns>
public static DayOfWeek[] GetAirDays(string day)
{
if (!string.IsNullOrEmpty(day))
{
if (string.Equals(day, "Daily", StringComparison.OrdinalIgnoreCase))
{
return new[]
{
DayOfWeek.Sunday,
DayOfWeek.Monday,
DayOfWeek.Tuesday,
DayOfWeek.Wednesday,
DayOfWeek.Thursday,
DayOfWeek.Friday,
DayOfWeek.Saturday
};
6 years ago
}
if (Enum.TryParse(day, true, out DayOfWeek value))
6 years ago
{
return new[]
{
value
};
6 years ago
}
return new DayOfWeek[] { };
6 years ago
}
6 years ago
return null;
}
}
}