2014-11-16 13:44:08 -07:00
|
|
|
|
using System;
|
2013-02-20 18:33:05 -07:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
2013-03-02 23:58:04 -07:00
|
|
|
|
namespace MediaBrowser.Controller.Library
|
2013-02-20 18:33:05 -07:00
|
|
|
|
{
|
2013-02-21 13:26:35 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Class TVUtils
|
|
|
|
|
/// </summary>
|
2013-02-20 18:33:05 -07:00
|
|
|
|
public static class TVUtils
|
|
|
|
|
{
|
2013-02-21 13:26:35 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The TVDB API key
|
|
|
|
|
/// </summary>
|
2013-05-17 08:29:22 -07:00
|
|
|
|
public static readonly string TvdbApiKey = "B89CE93890E9419B";
|
2013-02-21 13:26:35 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The banner URL
|
|
|
|
|
/// </summary>
|
2016-04-26 01:26:41 -07:00
|
|
|
|
public static readonly string BannerUrl = "https://www.thetvdb.com/banners/";
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
2013-02-21 13:26:35 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the air days.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="day">The day.</param>
|
|
|
|
|
/// <returns>List{DayOfWeek}.</returns>
|
2017-08-13 13:15:07 -07:00
|
|
|
|
public static DayOfWeek[] GetAirDays(string day)
|
2013-02-20 18:33:05 -07:00
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(day))
|
|
|
|
|
{
|
|
|
|
|
if (day.Equals("Daily", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
2017-08-13 13:15:07 -07:00
|
|
|
|
return new DayOfWeek[]
|
2013-02-20 18:33:05 -07:00
|
|
|
|
{
|
|
|
|
|
DayOfWeek.Sunday,
|
|
|
|
|
DayOfWeek.Monday,
|
|
|
|
|
DayOfWeek.Tuesday,
|
|
|
|
|
DayOfWeek.Wednesday,
|
|
|
|
|
DayOfWeek.Thursday,
|
|
|
|
|
DayOfWeek.Friday,
|
|
|
|
|
DayOfWeek.Saturday
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DayOfWeek value;
|
|
|
|
|
|
|
|
|
|
if (Enum.TryParse(day, true, out value))
|
|
|
|
|
{
|
2017-08-13 13:15:07 -07:00
|
|
|
|
return new DayOfWeek[]
|
2013-02-20 18:33:05 -07:00
|
|
|
|
{
|
|
|
|
|
value
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-13 13:15:07 -07:00
|
|
|
|
return new DayOfWeek[]{};
|
2013-02-20 18:33:05 -07:00
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|