jellyfin-server/MediaBrowser.Providers/Movies/ImdbExternalId.cs

40 lines
1.1 KiB
C#
Raw Normal View History

#pragma warning disable CS1591
using MediaBrowser.Controller.Entities;
2014-02-21 18:48:15 +00:00
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Entities.TV;
2015-07-12 19:33:00 +00:00
using MediaBrowser.Controller.LiveTv;
2014-02-21 18:48:15 +00:00
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
2014-02-21 18:48:15 +00:00
namespace MediaBrowser.Providers.Movies
{
public class ImdbExternalId : IExternalId
{
2019-09-10 20:37:53 +00:00
/// <inheritdoc />
2020-05-17 21:35:43 +00:00
public string ProviderName => "IMDb";
2014-02-21 18:48:15 +00:00
2019-09-10 20:37:53 +00:00
/// <inheritdoc />
2020-06-06 19:17:49 +00:00
public string Key => MetadataProvider.Imdb.ToString();
2014-02-21 18:48:15 +00:00
/// <inheritdoc />
public ExternalIdMediaType? Type => null;
2019-09-10 20:37:53 +00:00
/// <inheritdoc />
public string UrlFormatString => "https://www.imdb.com/title/{0}";
2014-02-21 18:48:15 +00:00
2019-09-10 20:37:53 +00:00
/// <inheritdoc />
2014-02-21 18:48:15 +00:00
public bool Supports(IHasProviderIds item)
{
2016-06-01 15:21:22 +00:00
// Supports images for tv movies
2019-09-10 20:37:53 +00:00
if (item is LiveTvProgram tvProgram && tvProgram.IsMovie)
2016-06-01 15:21:22 +00:00
{
return true;
}
2016-03-19 15:38:05 +00:00
return item is Movie || item is MusicVideo || item is Series || item is Episode || item is Trailer;
2014-02-21 18:48:15 +00:00
}
}
}