jellyfin/MediaBrowser.Controller/Library/TVUtils.cs

59 lines
1.8 KiB
C#
Raw Normal View History

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