FanartBaseProvider.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using MediaBrowser.Controller.Entities;
  2. using System;
  3. namespace MediaBrowser.Controller.Providers
  4. {
  5. /// <summary>
  6. /// Class FanartBaseProvider
  7. /// </summary>
  8. public abstract class FanartBaseProvider : BaseMetadataProvider
  9. {
  10. /// <summary>
  11. /// The LOG o_ FILE
  12. /// </summary>
  13. protected const string LOGO_FILE = "logo.png";
  14. /// <summary>
  15. /// The AR t_ FILE
  16. /// </summary>
  17. protected const string ART_FILE = "clearart.png";
  18. /// <summary>
  19. /// The THUM b_ FILE
  20. /// </summary>
  21. protected const string THUMB_FILE = "thumb.jpg";
  22. /// <summary>
  23. /// The DIS c_ FILE
  24. /// </summary>
  25. protected const string DISC_FILE = "disc.png";
  26. /// <summary>
  27. /// The BANNE r_ FILE
  28. /// </summary>
  29. protected const string BANNER_FILE = "banner.png";
  30. /// <summary>
  31. /// The API key
  32. /// </summary>
  33. protected const string APIKey = "5c6b04c68e904cfed1e6cbc9a9e683d4";
  34. /// <summary>
  35. /// Needses the refresh internal.
  36. /// </summary>
  37. /// <param name="item">The item.</param>
  38. /// <param name="providerInfo">The provider info.</param>
  39. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
  40. protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
  41. {
  42. if (item.DontFetchMeta) return false;
  43. return DateTime.UtcNow > (providerInfo.LastRefreshed.AddDays(Kernel.Instance.Configuration.MetadataRefreshDays))
  44. && ShouldFetch(item, providerInfo);
  45. }
  46. /// <summary>
  47. /// Gets a value indicating whether [requires internet].
  48. /// </summary>
  49. /// <value><c>true</c> if [requires internet]; otherwise, <c>false</c>.</value>
  50. public override bool RequiresInternet
  51. {
  52. get
  53. {
  54. return true;
  55. }
  56. }
  57. /// <summary>
  58. /// Gets the priority.
  59. /// </summary>
  60. /// <value>The priority.</value>
  61. public override MetadataProviderPriority Priority
  62. {
  63. get { return MetadataProviderPriority.Third; }
  64. }
  65. /// <summary>
  66. /// Shoulds the fetch.
  67. /// </summary>
  68. /// <param name="item">The item.</param>
  69. /// <param name="providerInfo">The provider info.</param>
  70. /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
  71. protected virtual bool ShouldFetch(BaseItem item, BaseProviderInfo providerInfo)
  72. {
  73. return false;
  74. }
  75. }
  76. }