2019-01-13 21:01:16 +01:00
|
|
|
using System;
|
2018-12-28 00:27:57 +01:00
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Library
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Class TVUtils
|
|
|
|
/// </summary>
|
|
|
|
public static class TVUtils
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The TVDB API key
|
|
|
|
/// </summary>
|
2019-01-30 21:23:23 +01:00
|
|
|
public static readonly string TvdbApiKey = "OG4V3YJ3FAP7FP2K";
|
2018-12-28 00:27:57 +01:00
|
|
|
public static readonly string TvdbBaseUrl = "https://www.thetvdb.com/";
|
|
|
|
/// <summary>
|
|
|
|
/// The banner URL
|
|
|
|
/// </summary>
|
|
|
|
public static readonly string BannerUrl = TvdbBaseUrl + "banners/";
|
|
|
|
|
|
|
|
/// <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 19:54:34 +01:00
|
|
|
return new[]
|
|
|
|
{
|
|
|
|
DayOfWeek.Sunday,
|
|
|
|
DayOfWeek.Monday,
|
|
|
|
DayOfWeek.Tuesday,
|
|
|
|
DayOfWeek.Wednesday,
|
|
|
|
DayOfWeek.Thursday,
|
|
|
|
DayOfWeek.Friday,
|
|
|
|
DayOfWeek.Saturday
|
|
|
|
};
|
2018-12-28 00:27:57 +01:00
|
|
|
}
|
|
|
|
|
2019-01-13 21:46:33 +01:00
|
|
|
if (Enum.TryParse(day, true, out DayOfWeek value))
|
2018-12-28 00:27:57 +01:00
|
|
|
{
|
2019-02-07 19:54:34 +01:00
|
|
|
return new[]
|
|
|
|
{
|
|
|
|
value
|
|
|
|
};
|
2018-12-28 00:27:57 +01:00
|
|
|
}
|
|
|
|
|
2019-01-13 20:25:32 +01:00
|
|
|
return new DayOfWeek[] { };
|
2018-12-28 00:27:57 +01:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|