MovieExternalIds.cs 4.2 KB

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