diff options
| author | Andrew Rabert <ar@nullsum.net> | 2018-12-27 18:27:57 -0500 |
|---|---|---|
| committer | Andrew Rabert <ar@nullsum.net> | 2018-12-27 18:27:57 -0500 |
| commit | a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 (patch) | |
| tree | a74f6ea4a8abfa1664a605d31d48bc38245ccf58 /MediaBrowser.Controller/Library/TVUtils.cs | |
| parent | 9bac3ac616b01f67db98381feb09d34ebe821f9a (diff) | |
Add GPL modules
Diffstat (limited to 'MediaBrowser.Controller/Library/TVUtils.cs')
| -rw-r--r-- | MediaBrowser.Controller/Library/TVUtils.cs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Library/TVUtils.cs b/MediaBrowser.Controller/Library/TVUtils.cs new file mode 100644 index 000000000..dc95ba112 --- /dev/null +++ b/MediaBrowser.Controller/Library/TVUtils.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Controller.Library +{ + /// <summary> + /// Class TVUtils + /// </summary> + public static class TVUtils + { + /// <summary> + /// The TVDB API key + /// </summary> + public static readonly string TvdbApiKey = "B89CE93890E9419B"; + 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)) + { + return new 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 DayOfWeek[] + { + value + }; + } + + return new DayOfWeek[]{}; + } + return null; + } + } +} |
