Fix api url

This commit is contained in:
Claus Vium 2019-08-18 13:34:44 +02:00
parent 817d9b3389
commit 5ea1299030
12 changed files with 16 additions and 15 deletions

View File

@ -11,7 +11,7 @@ namespace MediaBrowser.Providers.Tmdb.BoxSets
public string Key => MetadataProviders.TmdbCollection.ToString(); public string Key => MetadataProviders.TmdbCollection.ToString();
public string UrlFormatString => TmdbUtils.BaseMovieDbUrl + "collection/{0}"; public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "collection/{0}";
public bool Supports(IHasProviderIds item) public bool Supports(IHasProviderIds item)
{ {

View File

@ -25,7 +25,7 @@ namespace MediaBrowser.Providers.Tmdb.BoxSets
{ {
public class TmdbBoxSetProvider : IRemoteMetadataProvider<BoxSet, BoxSetInfo> public class TmdbBoxSetProvider : IRemoteMetadataProvider<BoxSet, BoxSetInfo>
{ {
private const string GetCollectionInfo3 = TmdbUtils.BaseMovieDbUrl + @"3/collection/{0}?api_key={1}&append_to_response=images"; private const string GetCollectionInfo3 = TmdbUtils.BaseTmdbApiUrl + @"3/collection/{0}?api_key={1}&append_to_response=images";
internal static TmdbBoxSetProvider Current; internal static TmdbBoxSetProvider Current;

View File

@ -12,7 +12,7 @@ namespace MediaBrowser.Providers.Tmdb.Movies
public string Key => MetadataProviders.Tmdb.ToString(); public string Key => MetadataProviders.Tmdb.ToString();
public string UrlFormatString => TmdbUtils.BaseMovieDbUrl + "movie/{0}"; public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "movie/{0}";
public bool Supports(IHasProviderIds item) public bool Supports(IHasProviderIds item)
{ {

View File

@ -157,8 +157,8 @@ namespace MediaBrowser.Providers.Tmdb.Movies
} }
} }
private const string TmdbConfigUrl = TmdbUtils.BaseMovieDbUrl + "3/configuration?api_key={0}"; private const string TmdbConfigUrl = TmdbUtils.BaseTmdbApiUrl + "3/configuration?api_key={0}";
private const string GetMovieInfo3 = TmdbUtils.BaseMovieDbUrl + @"3/movie/{0}?api_key={1}&append_to_response=casts,releases,images,keywords,trailers"; private const string GetMovieInfo3 = TmdbUtils.BaseTmdbApiUrl + @"3/movie/{0}?api_key={1}&append_to_response=casts,releases,images,keywords,trailers";
/// <summary> /// <summary>
/// Gets the movie data path. /// Gets the movie data path.

View File

@ -19,7 +19,7 @@ namespace MediaBrowser.Providers.Tmdb.Movies
public class TmdbSearch public class TmdbSearch
{ {
private static readonly CultureInfo EnUs = new CultureInfo("en-US"); private static readonly CultureInfo EnUs = new CultureInfo("en-US");
private const string Search3 = TmdbUtils.BaseMovieDbUrl + @"3/search/{3}?api_key={1}&query={0}&language={2}"; private const string Search3 = TmdbUtils.BaseTmdbApiUrl + @"3/search/{3}?api_key={1}&query={0}&language={2}";
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IJsonSerializer _json; private readonly IJsonSerializer _json;

View File

@ -10,7 +10,7 @@ namespace MediaBrowser.Providers.Tmdb.People
public string Key => MetadataProviders.Tmdb.ToString(); public string Key => MetadataProviders.Tmdb.ToString();
public string UrlFormatString => TmdbUtils.BaseMovieDbUrl + "person/{0}"; public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "person/{0}";
public bool Supports(IHasProviderIds item) public bool Supports(IHasProviderIds item)
{ {

View File

@ -86,7 +86,7 @@ namespace MediaBrowser.Providers.Tmdb.People
return new List<RemoteSearchResult>(); return new List<RemoteSearchResult>();
} }
var url = string.Format(TmdbUtils.BaseMovieDbUrl + @"3/search/person?api_key={1}&query={0}", WebUtility.UrlEncode(searchInfo.Name), TmdbUtils.ApiKey); var url = string.Format(TmdbUtils.BaseTmdbApiUrl + @"3/search/person?api_key={1}&query={0}", WebUtility.UrlEncode(searchInfo.Name), TmdbUtils.ApiKey);
using (var response = await TmdbMovieProvider.Current.GetMovieDbResponse(new HttpRequestOptions using (var response = await TmdbMovieProvider.Current.GetMovieDbResponse(new HttpRequestOptions
{ {
@ -219,7 +219,7 @@ namespace MediaBrowser.Providers.Tmdb.People
return; return;
} }
var url = string.Format(TmdbUtils.BaseMovieDbUrl + @"3/person/{1}?api_key={0}&append_to_response=credits,images,external_ids", TmdbUtils.ApiKey, id); var url = string.Format(TmdbUtils.BaseTmdbApiUrl + @"3/person/{1}?api_key={0}&append_to_response=credits,images,external_ids", TmdbUtils.ApiKey, id);
using (var response = await TmdbMovieProvider.Current.GetMovieDbResponse(new HttpRequestOptions using (var response = await TmdbMovieProvider.Current.GetMovieDbResponse(new HttpRequestOptions
{ {

View File

@ -17,7 +17,7 @@ namespace MediaBrowser.Providers.Tmdb.TV
{ {
public abstract class TmdbEpisodeProviderBase public abstract class TmdbEpisodeProviderBase
{ {
private const string EpisodeUrlPattern = TmdbUtils.BaseMovieDbUrl + @"3/tv/{0}/season/{1}/episode/{2}?api_key={3}&append_to_response=images,external_ids,credits,videos"; private const string EpisodeUrlPattern = TmdbUtils.BaseTmdbApiUrl + @"3/tv/{0}/season/{1}/episode/{2}?api_key={3}&append_to_response=images,external_ids,credits,videos";
private readonly IHttpClient _httpClient; private readonly IHttpClient _httpClient;
private readonly IServerConfigurationManager _configurationManager; private readonly IServerConfigurationManager _configurationManager;
private readonly IJsonSerializer _jsonSerializer; private readonly IJsonSerializer _jsonSerializer;

View File

@ -24,7 +24,7 @@ namespace MediaBrowser.Providers.Tmdb.TV
{ {
public class TmdbSeasonProvider : IRemoteMetadataProvider<Season, SeasonInfo> public class TmdbSeasonProvider : IRemoteMetadataProvider<Season, SeasonInfo>
{ {
private const string GetTvInfo3 = TmdbUtils.BaseMovieDbUrl + @"3/tv/{0}/season/{1}?api_key={2}&append_to_response=images,keywords,external_ids,credits,videos"; private const string GetTvInfo3 = TmdbUtils.BaseTmdbApiUrl + @"3/tv/{0}/season/{1}?api_key={2}&append_to_response=images,keywords,external_ids,credits,videos";
private readonly IHttpClient _httpClient; private readonly IHttpClient _httpClient;
private readonly IServerConfigurationManager _configurationManager; private readonly IServerConfigurationManager _configurationManager;
private readonly IJsonSerializer _jsonSerializer; private readonly IJsonSerializer _jsonSerializer;

View File

@ -10,7 +10,7 @@ namespace MediaBrowser.Providers.Tmdb.TV
public string Key => MetadataProviders.Tmdb.ToString(); public string Key => MetadataProviders.Tmdb.ToString();
public string UrlFormatString => TmdbUtils.BaseMovieDbUrl + "tv/{0}"; public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "tv/{0}";
public bool Supports(IHasProviderIds item) public bool Supports(IHasProviderIds item)
{ {

View File

@ -27,7 +27,7 @@ namespace MediaBrowser.Providers.Tmdb.TV
{ {
public class TmdbSeriesProvider : IRemoteMetadataProvider<Series, SeriesInfo>, IHasOrder public class TmdbSeriesProvider : IRemoteMetadataProvider<Series, SeriesInfo>, IHasOrder
{ {
private const string GetTvInfo3 = TmdbUtils.BaseMovieDbUrl + @"3/tv/{0}?api_key={1}&append_to_response=credits,images,keywords,external_ids,videos,content_ratings"; 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 CultureInfo _usCulture = new CultureInfo("en-US"); private readonly CultureInfo _usCulture = new CultureInfo("en-US");
internal static TmdbSeriesProvider Current { get; private set; } internal static TmdbSeriesProvider Current { get; private set; }
@ -470,7 +470,7 @@ namespace MediaBrowser.Providers.Tmdb.TV
private async Task<RemoteSearchResult> FindByExternalId(string id, string externalSource, CancellationToken cancellationToken) private async Task<RemoteSearchResult> FindByExternalId(string id, string externalSource, CancellationToken cancellationToken)
{ {
var url = string.Format(TmdbUtils.BaseMovieDbUrl + @"3/find/{0}?api_key={1}&external_source={2}", var url = string.Format(TmdbUtils.BaseTmdbApiUrl + @"3/find/{0}?api_key={1}&external_source={2}",
id, id,
TmdbUtils.ApiKey, TmdbUtils.ApiKey,
externalSource); externalSource);

View File

@ -6,7 +6,8 @@ namespace MediaBrowser.Providers.Tmdb
{ {
public static class TmdbUtils public static class TmdbUtils
{ {
public const string BaseMovieDbUrl = "https://www.themoviedb.org/"; public const string BaseTmdbUrl = "https://www.themoviedb.org/";
public const string BaseTmdbApiUrl = "https://api.themoviedb.org/";
public const string ProviderName = "TheMovieDb"; public const string ProviderName = "TheMovieDb";
public const string ApiKey = "4219e299c89411838049ab0dab19ebd5"; public const string ApiKey = "4219e299c89411838049ab0dab19ebd5";
public const string AcceptHeader = "application/json,image/*"; public const string AcceptHeader = "application/json,image/*";