using System;
using MediaBrowser.Model.Entities;
using MediaBrowser.Providers.Tmdb.Models.General;
namespace MediaBrowser.Providers.Tmdb
{
///
/// Utilities for the TMDb provider
///
public static class TmdbUtils
{
///
/// URL of the TMDB instance to use.
///
public const string BaseTmdbUrl = "https://www.themoviedb.org/";
///
/// URL of the TMDB API instance to use.
///
public const string BaseTmdbApiUrl = "https://api.themoviedb.org/";
///
/// Name of the provider.
///
public const string ProviderName = "TheMovieDb";
///
/// API key to use when performing an API call.
///
public const string ApiKey = "4219e299c89411838049ab0dab19ebd5";
///
/// Value of the Accept header for requests to the provider.
///
public const string AcceptHeader = "application/json,image/*";
///
/// Maps the TMDB provided roles for crew members to Jellyfin roles.
///
/// Crew member to map against the Jellyfin person types.
/// The Jellyfin person type.
public static string MapCrewToPersonType(Crew crew)
{
if (crew.Department.Equals("production", StringComparison.InvariantCultureIgnoreCase)
&& crew.Job.Contains("director", StringComparison.InvariantCultureIgnoreCase))
{
return PersonType.Director;
}
if (crew.Department.Equals("production", StringComparison.InvariantCultureIgnoreCase)
&& crew.Job.Contains("producer", StringComparison.InvariantCultureIgnoreCase))
{
return PersonType.Producer;
}
if (crew.Department.Equals("writing", StringComparison.InvariantCultureIgnoreCase))
{
return PersonType.Writer;
}
return null;
}
}
}