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