TVUtils.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. namespace MediaBrowser.Controller.Library
  3. {
  4. /// <summary>
  5. /// Class TVUtils
  6. /// </summary>
  7. public static class TVUtils
  8. {
  9. /// <summary>
  10. /// The TVDB API key
  11. /// </summary>
  12. public static readonly string TvdbApiKey = "OG4V3YJ3FAP7FP2K";
  13. public static readonly string TvdbBaseUrl = "https://www.thetvdb.com/";
  14. /// <summary>
  15. /// The banner URL
  16. /// </summary>
  17. public static readonly string BannerUrl = TvdbBaseUrl + "banners/";
  18. /// <summary>
  19. /// Gets the air days.
  20. /// </summary>
  21. /// <param name="day">The day.</param>
  22. /// <returns>List{DayOfWeek}.</returns>
  23. public static DayOfWeek[] GetAirDays(string day)
  24. {
  25. if (!string.IsNullOrEmpty(day))
  26. {
  27. if (string.Equals(day, "Daily", StringComparison.OrdinalIgnoreCase))
  28. {
  29. return new DayOfWeek[]
  30. {
  31. DayOfWeek.Sunday,
  32. DayOfWeek.Monday,
  33. DayOfWeek.Tuesday,
  34. DayOfWeek.Wednesday,
  35. DayOfWeek.Thursday,
  36. DayOfWeek.Friday,
  37. DayOfWeek.Saturday
  38. };
  39. }
  40. DayOfWeek value;
  41. if (Enum.TryParse(day, true, out value))
  42. {
  43. return new DayOfWeek[]
  44. {
  45. value
  46. };
  47. }
  48. return new DayOfWeek[] { };
  49. }
  50. return null;
  51. }
  52. }
  53. }