mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-26 07:28:43 +02:00
Address suggestions
This commit is contained in:
parent
d5ad53e4bb
commit
b961c3c9ae
|
@ -26,6 +26,8 @@ namespace MediaBrowser.Providers.Tmdb.TV
|
||||||
{
|
{
|
||||||
public class TmdbSeriesProvider : IRemoteMetadataProvider<Series, SeriesInfo>, IHasOrder
|
public class TmdbSeriesProvider : IRemoteMetadataProvider<Series, SeriesInfo>, IHasOrder
|
||||||
{
|
{
|
||||||
|
private const string GetTvInfo3 = TmdbUtils.BaseTmdbApiUrl + @"3/tv/{0}?api_key={1}&append_to_response=credits,images,keywords,external_ids,videos,content_ratings";
|
||||||
|
|
||||||
private readonly IJsonSerializer _jsonSerializer;
|
private readonly IJsonSerializer _jsonSerializer;
|
||||||
private readonly IFileSystem _fileSystem;
|
private readonly IFileSystem _fileSystem;
|
||||||
private readonly IServerConfigurationManager _configurationManager;
|
private readonly IServerConfigurationManager _configurationManager;
|
||||||
|
@ -35,7 +37,6 @@ namespace MediaBrowser.Providers.Tmdb.TV
|
||||||
private readonly ILibraryManager _libraryManager;
|
private readonly ILibraryManager _libraryManager;
|
||||||
|
|
||||||
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
||||||
private const string GetTvInfo3 = TmdbUtils.BaseTmdbApiUrl + @"3/tv/{0}?api_key={1}&append_to_response=credits,images,keywords,external_ids,videos,content_ratings";
|
|
||||||
|
|
||||||
internal static TmdbSeriesProvider Current { get; private set; }
|
internal static TmdbSeriesProvider Current { get; private set; }
|
||||||
|
|
||||||
|
@ -355,7 +356,12 @@ namespace MediaBrowser.Providers.Tmdb.TV
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
seriesResult.AddPerson(new PersonInfo { Name = person.Name.Trim(), Role = person.Job, Type = type });
|
seriesResult.AddPerson(new PersonInfo
|
||||||
|
{
|
||||||
|
Name = person.Name.Trim(),
|
||||||
|
Role = person.Job,
|
||||||
|
Type = type
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,24 +4,51 @@ using MediaBrowser.Providers.Tmdb.Models.General;
|
||||||
|
|
||||||
namespace MediaBrowser.Providers.Tmdb
|
namespace MediaBrowser.Providers.Tmdb
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Utilities for the TMDb provider
|
||||||
|
/// </summary>
|
||||||
public static class TmdbUtils
|
public static class TmdbUtils
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// URL of the TMDB instance to use.
|
||||||
|
/// </summary>
|
||||||
public const string BaseTmdbUrl = "https://www.themoviedb.org/";
|
public const string BaseTmdbUrl = "https://www.themoviedb.org/";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// URL of the TMDB API instance to use.
|
||||||
|
/// </summary>
|
||||||
public const string BaseTmdbApiUrl = "https://api.themoviedb.org/";
|
public const string BaseTmdbApiUrl = "https://api.themoviedb.org/";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of the provider.
|
||||||
|
/// </summary>
|
||||||
public const string ProviderName = "TheMovieDb";
|
public const string ProviderName = "TheMovieDb";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// API key to use when performing an API call.
|
||||||
|
/// </summary>
|
||||||
public const string ApiKey = "4219e299c89411838049ab0dab19ebd5";
|
public const string ApiKey = "4219e299c89411838049ab0dab19ebd5";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Value of the Accept header for requests to the provider.
|
||||||
|
/// </summary>
|
||||||
public const string AcceptHeader = "application/json,image/*";
|
public const string AcceptHeader = "application/json,image/*";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Maps the TMDB provided roles for crew members to Jellyfin roles.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="crew">Crew member to map against the Jellyfin person types.</param>
|
||||||
|
/// <returns>The Jellyfin person type.</returns>
|
||||||
public static string MapCrewToPersonType(Crew crew)
|
public static string MapCrewToPersonType(Crew crew)
|
||||||
{
|
{
|
||||||
if (crew.Department.Equals("production", StringComparison.InvariantCultureIgnoreCase)
|
if (crew.Department.Equals("production", StringComparison.InvariantCultureIgnoreCase)
|
||||||
&& crew.Job.IndexOf("director", StringComparison.InvariantCultureIgnoreCase) != -1)
|
&& crew.Job.Contains("director", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
return PersonType.Director;
|
return PersonType.Director;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crew.Department.Equals("production", StringComparison.InvariantCultureIgnoreCase)
|
if (crew.Department.Equals("production", StringComparison.InvariantCultureIgnoreCase)
|
||||||
&& crew.Job.IndexOf("producer", StringComparison.InvariantCultureIgnoreCase) != -1)
|
&& crew.Job.Contains("producer", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
return PersonType.Producer;
|
return PersonType.Producer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue