using System;
using System.Diagnostics.CodeAnalysis;
namespace MediaBrowser.Controller.Library
{
///
/// Class TVUtils.
///
public static class TVUtils
{
///
/// Gets the air days.
///
/// The day.
/// List{DayOfWeek}.
[return: NotNullIfNotNull("day")]
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
};
}
if (Enum.TryParse(day, true, out DayOfWeek value))
{
return new[]
{
value
};
}
return Array.Empty();
}
return null;
}
}
}