2
0

TVUtils.cs 1.8 KB

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