MovieExternalIds.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Controller.Entities.Movies;
  3. using MediaBrowser.Controller.Entities.TV;
  4. using MediaBrowser.Controller.LiveTv;
  5. using MediaBrowser.Controller.Providers;
  6. using MediaBrowser.Model.Entities;
  7. namespace MediaBrowser.Providers.Movies
  8. {
  9. public class MovieDbMovieExternalId : IExternalId
  10. {
  11. public string Name
  12. {
  13. get { return "TheMovieDb"; }
  14. }
  15. public string Key
  16. {
  17. get { return MetadataProviders.Tmdb.ToString(); }
  18. }
  19. public string UrlFormatString
  20. {
  21. get { return "https://www.themoviedb.org/movie/{0}"; }
  22. }
  23. public bool Supports(IHasProviderIds item)
  24. {
  25. // Supports images for tv movies
  26. var tvProgram = item as LiveTvProgram;
  27. if (tvProgram != null && tvProgram.IsMovie)
  28. {
  29. return true;
  30. }
  31. return item is Movie || item is MusicVideo || item is Trailer;
  32. }
  33. }
  34. public class MovieDbSeriesExternalId : IExternalId
  35. {
  36. public string Name
  37. {
  38. get { return "TheMovieDb"; }
  39. }
  40. public string Key
  41. {
  42. get { return MetadataProviders.Tmdb.ToString(); }
  43. }
  44. public string UrlFormatString
  45. {
  46. get { return "https://www.themoviedb.org/tv/{0}"; }
  47. }
  48. public bool Supports(IHasProviderIds item)
  49. {
  50. return item is Series;
  51. }
  52. }
  53. public class MovieDbMovieCollectionExternalId : IExternalId
  54. {
  55. public string Name
  56. {
  57. get { return "TheMovieDb Collection"; }
  58. }
  59. public string Key
  60. {
  61. get { return MetadataProviders.TmdbCollection.ToString(); }
  62. }
  63. public string UrlFormatString
  64. {
  65. get { return "https://www.themoviedb.org/collection/{0}"; }
  66. }
  67. public bool Supports(IHasProviderIds item)
  68. {
  69. return item is Movie || item is MusicVideo || item is Trailer;
  70. }
  71. }
  72. public class MovieDbPersonExternalId : IExternalId
  73. {
  74. public string Name
  75. {
  76. get { return "TheMovieDb"; }
  77. }
  78. public string Key
  79. {
  80. get { return MetadataProviders.Tmdb.ToString(); }
  81. }
  82. public string UrlFormatString
  83. {
  84. get { return "https://www.themoviedb.org/person/{0}"; }
  85. }
  86. public bool Supports(IHasProviderIds item)
  87. {
  88. return item is Person;
  89. }
  90. }
  91. public class MovieDbCollectionExternalId : IExternalId
  92. {
  93. public string Name
  94. {
  95. get { return "TheMovieDb"; }
  96. }
  97. public string Key
  98. {
  99. get { return MetadataProviders.Tmdb.ToString(); }
  100. }
  101. public string UrlFormatString
  102. {
  103. get { return "https://www.themoviedb.org/collection/{0}"; }
  104. }
  105. public bool Supports(IHasProviderIds item)
  106. {
  107. return item is BoxSet;
  108. }
  109. }
  110. public class ImdbExternalId : IExternalId
  111. {
  112. public string Name
  113. {
  114. get { return "IMDb"; }
  115. }
  116. public string Key
  117. {
  118. get { return MetadataProviders.Imdb.ToString(); }
  119. }
  120. public string UrlFormatString
  121. {
  122. get { return "http://www.imdb.com/title/{0}"; }
  123. }
  124. public bool Supports(IHasProviderIds item)
  125. {
  126. return item is Movie || item is MusicVideo || item is Series || item is Episode || item is Trailer;
  127. }
  128. }
  129. public class ImdbPersonExternalId : IExternalId
  130. {
  131. public string Name
  132. {
  133. get { return "IMDb"; }
  134. }
  135. public string Key
  136. {
  137. get { return MetadataProviders.Imdb.ToString(); }
  138. }
  139. public string UrlFormatString
  140. {
  141. get { return "http://www.imdb.com/name/{0}"; }
  142. }
  143. public bool Supports(IHasProviderIds item)
  144. {
  145. return item is Person;
  146. }
  147. }
  148. }