123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- using MediaBrowser.Controller.Channels;
- using MediaBrowser.Controller.Entities;
- using MediaBrowser.Controller.Entities.Movies;
- using MediaBrowser.Controller.Entities.TV;
- using MediaBrowser.Controller.LiveTv;
- using MediaBrowser.Controller.Providers;
- using MediaBrowser.Model.Channels;
- using MediaBrowser.Model.Entities;
- namespace MediaBrowser.Providers.Movies
- {
- public class MovieDbMovieExternalId : IExternalId
- {
- public string Name
- {
- get { return "TheMovieDb"; }
- }
- public string Key
- {
- get { return MetadataProviders.Tmdb.ToString(); }
- }
- public string UrlFormatString
- {
- get { return "http://www.themoviedb.org/movie/{0}"; }
- }
- public bool Supports(IHasProviderIds item)
- {
- var channelItem = item as ChannelVideoItem;
- if (channelItem != null && channelItem.ContentType == ChannelMediaContentType.MovieExtra && channelItem.ExtraType == ExtraType.Trailer)
- {
- return true;
- }
- // Supports images for tv movies
- var tvProgram = item as LiveTvProgram;
- if (tvProgram != null && tvProgram.IsMovie)
- {
- return true;
- }
- return item is Movie || item is MusicVideo;
- }
- }
- public class MovieDbSeriesExternalId : IExternalId
- {
- public string Name
- {
- get { return "TheMovieDb"; }
- }
- public string Key
- {
- get { return MetadataProviders.Tmdb.ToString(); }
- }
- public string UrlFormatString
- {
- get { return "http://www.themoviedb.org/tv/{0}"; }
- }
- public bool Supports(IHasProviderIds item)
- {
- return item is Series;
- }
- }
- public class MovieDbMovieCollectionExternalId : IExternalId
- {
- public string Name
- {
- get { return "TheMovieDb Collection"; }
- }
- public string Key
- {
- get { return MetadataProviders.TmdbCollection.ToString(); }
- }
- public string UrlFormatString
- {
- get { return "http://www.themoviedb.org/collection/{0}"; }
- }
- public bool Supports(IHasProviderIds item)
- {
- return item is Movie || item is MusicVideo;
- }
- }
- public class MovieDbPersonExternalId : IExternalId
- {
- public string Name
- {
- get { return "TheMovieDb"; }
- }
- public string Key
- {
- get { return MetadataProviders.Tmdb.ToString(); }
- }
- public string UrlFormatString
- {
- get { return "http://www.themoviedb.org/person/{0}"; }
- }
- public bool Supports(IHasProviderIds item)
- {
- return item is Person;
- }
- }
- public class MovieDbCollectionExternalId : IExternalId
- {
- public string Name
- {
- get { return "TheMovieDb"; }
- }
- public string Key
- {
- get { return MetadataProviders.Tmdb.ToString(); }
- }
- public string UrlFormatString
- {
- get { return "http://www.themoviedb.org/collection/{0}"; }
- }
- public bool Supports(IHasProviderIds item)
- {
- return item is BoxSet;
- }
- }
- public class ImdbExternalId : IExternalId
- {
- public string Name
- {
- get { return "IMDb"; }
- }
- public string Key
- {
- get { return MetadataProviders.Imdb.ToString(); }
- }
- public string UrlFormatString
- {
- get { return "http://www.imdb.com/title/{0}"; }
- }
- public bool Supports(IHasProviderIds item)
- {
- var channelItem = item as ChannelVideoItem;
- if (channelItem != null && channelItem.ContentType == ChannelMediaContentType.MovieExtra && channelItem.ExtraType == ExtraType.Trailer)
- {
- return true;
- }
- return item is Movie || item is MusicVideo || item is Series || item is Episode;
- }
- }
- public class ImdbPersonExternalId : IExternalId
- {
- public string Name
- {
- get { return "IMDb"; }
- }
- public string Key
- {
- get { return MetadataProviders.Imdb.ToString(); }
- }
- public string UrlFormatString
- {
- get { return "http://www.imdb.com/name/{0}"; }
- }
- public bool Supports(IHasProviderIds item)
- {
- return item is Person;
- }
- }
- }
|