2019-01-13 15:01:16 -05:00
|
|
|
using System;
|
2018-12-27 18:27:57 -05:00
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Library
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-06-15 18:37:52 -04:00
|
|
|
/// Class TVUtils.
|
2018-12-27 18:27:57 -05:00
|
|
|
/// </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))
|
|
|
|
{
|
2019-02-07 13:54:34 -05:00
|
|
|
return new[]
|
|
|
|
{
|
|
|
|
DayOfWeek.Sunday,
|
|
|
|
DayOfWeek.Monday,
|
|
|
|
DayOfWeek.Tuesday,
|
|
|
|
DayOfWeek.Wednesday,
|
|
|
|
DayOfWeek.Thursday,
|
|
|
|
DayOfWeek.Friday,
|
|
|
|
DayOfWeek.Saturday
|
|
|
|
};
|
2018-12-27 18:27:57 -05:00
|
|
|
}
|
|
|
|
|
2019-01-13 15:46:33 -05:00
|
|
|
if (Enum.TryParse(day, true, out DayOfWeek value))
|
2018-12-27 18:27:57 -05:00
|
|
|
{
|
2019-02-07 13:54:34 -05:00
|
|
|
return new[]
|
|
|
|
{
|
|
|
|
value
|
|
|
|
};
|
2018-12-27 18:27:57 -05:00
|
|
|
}
|
|
|
|
|
2019-01-13 14:25:32 -05:00
|
|
|
return new DayOfWeek[] { };
|
2018-12-27 18:27:57 -05:00
|
|
|
}
|
2020-06-15 17:43:52 -04:00
|
|
|
|
2018-12-27 18:27:57 -05:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|