aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-02-13 16:03:41 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-02-13 16:03:41 -0500
commiteb2d3d0889e5946787d9a9ab94e7b8f5a964c78c (patch)
tree085766b43fc080fb58c155f2e3ba5d57ae2ba707
parent5181b31886f5f4cc31890bbe4810dd467996e903 (diff)
add placeholder for omdb base url
-rw-r--r--MediaBrowser.Providers/Omdb/OmdbItemProvider.cs5
-rw-r--r--MediaBrowser.Providers/Omdb/OmdbProvider.cs11
2 files changed, 11 insertions, 5 deletions
diff --git a/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs b/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs
index 73668b73c..477543d5e 100644
--- a/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs
+++ b/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs
@@ -18,8 +18,6 @@ using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
-using MediaBrowser.Common.IO;
-using MediaBrowser.Controller.IO;
namespace MediaBrowser.Providers.Omdb
{
@@ -74,7 +72,8 @@ namespace MediaBrowser.Providers.Omdb
var imdbId = searchInfo.GetProviderId(MetadataProviders.Imdb);
- var url = "https://www.omdbapi.com/?plot=full&r=json";
+ var baseUrl = await OmdbProvider.GetOmdbBaseUrl(cancellationToken).ConfigureAwait(false);
+ var url = baseUrl + "/?plot=full&r=json";
if (type == "episode" && episodeSearchInfo != null)
{
episodeSearchInfo.SeriesProviderIds.TryGetValue(MetadataProviders.Imdb.ToString(), out imdbId);
diff --git a/MediaBrowser.Providers/Omdb/OmdbProvider.cs b/MediaBrowser.Providers/Omdb/OmdbProvider.cs
index fdd334e6e..024853778 100644
--- a/MediaBrowser.Providers/Omdb/OmdbProvider.cs
+++ b/MediaBrowser.Providers/Omdb/OmdbProvider.cs
@@ -272,6 +272,11 @@ namespace MediaBrowser.Providers.Omdb
return false;
}
+ public static async Task<string> GetOmdbBaseUrl(CancellationToken cancellationToken)
+ {
+ return "https://www.omdbapi.com";
+ }
+
private async Task<string> EnsureItemInfo(string imdbId, CancellationToken cancellationToken)
{
if (string.IsNullOrWhiteSpace(imdbId))
@@ -294,7 +299,8 @@ namespace MediaBrowser.Providers.Omdb
}
}
- var url = string.Format("https://www.omdbapi.com/?i={0}&plot=full&tomatoes=true&r=json", imdbParam);
+ var baseUrl = await GetOmdbBaseUrl(cancellationToken).ConfigureAwait(false);
+ var url = string.Format(baseUrl + "/?i={0}&plot=full&tomatoes=true&r=json", imdbParam);
using (var stream = await GetOmdbResponse(_httpClient, url, cancellationToken).ConfigureAwait(false))
{
@@ -328,7 +334,8 @@ namespace MediaBrowser.Providers.Omdb
}
}
- var url = string.Format("https://www.omdbapi.com/?i={0}&season={1}&detail=full", imdbParam, seasonId);
+ var baseUrl = await GetOmdbBaseUrl(cancellationToken).ConfigureAwait(false);
+ var url = string.Format(baseUrl + "/?i={0}&season={1}&detail=full", imdbParam, seasonId);
using (var stream = await GetOmdbResponse(_httpClient, url, cancellationToken).ConfigureAwait(false))
{