TmdbMovieExternalId.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using MediaBrowser.Controller.Entities.Movies;
  2. using MediaBrowser.Controller.LiveTv;
  3. using MediaBrowser.Controller.Providers;
  4. using MediaBrowser.Model.Entities;
  5. using MediaBrowser.Model.Providers;
  6. namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
  7. {
  8. /// <summary>
  9. /// External ID for a TMBD movie.
  10. /// </summary>
  11. public class TmdbMovieExternalId : IExternalId
  12. {
  13. /// <inheritdoc />
  14. public string ProviderName => TmdbUtils.ProviderName;
  15. /// <inheritdoc />
  16. public string Key => MetadataProvider.Tmdb.ToString();
  17. /// <inheritdoc />
  18. public ExternalIdMediaType? Type => ExternalIdMediaType.Movie;
  19. /// <inheritdoc />
  20. public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "movie/{0}";
  21. /// <inheritdoc />
  22. public bool Supports(IHasProviderIds item)
  23. {
  24. // Supports images for tv movies
  25. if (item is LiveTvProgram tvProgram && tvProgram.IsMovie)
  26. {
  27. return true;
  28. }
  29. return item is Movie;
  30. }
  31. }
  32. }