aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-01-12 02:01:19 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-01-12 02:01:19 -0500
commitf55217406985ad21da44aa523353f33e3f720ccd (patch)
tree0714131a46dfa4ea339bf1c4a38988a2231fb77f
parentf9662e23e911a55139ba1d0ccc1efaff861de436 (diff)
fixes #979 - Support personal fanart api key
-rw-r--r--MediaBrowser.Model/Configuration/ServerConfiguration.cs2
-rw-r--r--MediaBrowser.Providers/Movies/FanArtMovieUpdatesPostScanTask.cs9
-rw-r--r--MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs5
-rw-r--r--MediaBrowser.Providers/Music/FanArtArtistProvider.cs5
-rw-r--r--MediaBrowser.Providers/Music/FanArtUpdatesPostScanTask.cs9
-rw-r--r--MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs9
-rw-r--r--MediaBrowser.Providers/TV/FanartSeriesProvider.cs5
-rw-r--r--MediaBrowser.Server.Implementations/Localization/Server/server.json4
8 files changed, 44 insertions, 4 deletions
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
index f9c5c6567..e30cf1789 100644
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
@@ -149,7 +149,9 @@ namespace MediaBrowser.Model.Configuration
/// <value><c>true</c> if [enable tv db updates]; otherwise, <c>false</c>.</value>
public bool EnableTvDbUpdates { get; set; }
public bool EnableTmdbUpdates { get; set; }
+
public bool EnableFanArtUpdates { get; set; }
+ public string FanartApiKey { get; set; }
/// <summary>
/// Gets or sets the image saving convention.
diff --git a/MediaBrowser.Providers/Movies/FanArtMovieUpdatesPostScanTask.cs b/MediaBrowser.Providers/Movies/FanArtMovieUpdatesPostScanTask.cs
index 2936fec0e..2f3d8ceea 100644
--- a/MediaBrowser.Providers/Movies/FanArtMovieUpdatesPostScanTask.cs
+++ b/MediaBrowser.Providers/Movies/FanArtMovieUpdatesPostScanTask.cs
@@ -98,10 +98,17 @@ namespace MediaBrowser.Providers.Movies
private async Task<IEnumerable<string>> GetMovieIdsToUpdate(IEnumerable<string> existingIds, string lastUpdateTime, CancellationToken cancellationToken)
{
+ var url = string.Format(UpdatesUrl, FanartArtistProvider.ApiKey, lastUpdateTime);
+
+ if (!string.IsNullOrWhiteSpace(_config.Configuration.FanartApiKey))
+ {
+ url += "&client_key=" + _config.Configuration.FanartApiKey;
+ }
+
// First get last time
using (var stream = await _httpClient.Get(new HttpRequestOptions
{
- Url = string.Format(UpdatesUrl, FanartArtistProvider.ApiKey, lastUpdateTime),
+ Url = url,
CancellationToken = cancellationToken,
EnableHttpCompression = true,
ResourcePool = FanartArtistProvider.Current.FanArtResourcePool
diff --git a/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs b/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs
index 6813f2ff5..91d8830e6 100644
--- a/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs
+++ b/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs
@@ -283,6 +283,11 @@ namespace MediaBrowser.Providers.Movies
var url = string.Format(FanArtBaseUrl, FanartArtistProvider.ApiKey, id);
+ if (!string.IsNullOrWhiteSpace(_config.Configuration.FanartApiKey))
+ {
+ url += "&client_key=" + _config.Configuration.FanartApiKey;
+ }
+
var path = GetFanartJsonPath(id);
Directory.CreateDirectory(Path.GetDirectoryName(path));
diff --git a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs
index 6f633cfc8..6bb4b0aef 100644
--- a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs
+++ b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs
@@ -423,6 +423,11 @@ namespace MediaBrowser.Providers.Music
var url = string.Format(FanArtBaseUrl, ApiKey, musicBrainzId);
+ if (!string.IsNullOrWhiteSpace(_config.Configuration.FanartApiKey))
+ {
+ url += "&client_key=" + _config.Configuration.FanartApiKey;
+ }
+
var xmlPath = GetArtistXmlPath(_config.ApplicationPaths, musicBrainzId);
Directory.CreateDirectory(Path.GetDirectoryName(xmlPath));
diff --git a/MediaBrowser.Providers/Music/FanArtUpdatesPostScanTask.cs b/MediaBrowser.Providers/Music/FanArtUpdatesPostScanTask.cs
index 4c6706287..703153e31 100644
--- a/MediaBrowser.Providers/Music/FanArtUpdatesPostScanTask.cs
+++ b/MediaBrowser.Providers/Music/FanArtUpdatesPostScanTask.cs
@@ -104,10 +104,17 @@ namespace MediaBrowser.Providers.Music
/// <returns>Task{IEnumerable{System.String}}.</returns>
private async Task<IEnumerable<string>> GetArtistIdsToUpdate(IEnumerable<string> existingArtistIds, string lastUpdateTime, CancellationToken cancellationToken)
{
+ var url = string.Format(UpdatesUrl, FanartArtistProvider.ApiKey, lastUpdateTime);
+
+ if (!string.IsNullOrWhiteSpace(_config.Configuration.FanartApiKey))
+ {
+ url += "&client_key=" + _config.Configuration.FanartApiKey;
+ }
+
// First get last time
using (var stream = await _httpClient.Get(new HttpRequestOptions
{
- Url = string.Format(UpdatesUrl, FanartArtistProvider.ApiKey, lastUpdateTime),
+ Url = url,
CancellationToken = cancellationToken,
EnableHttpCompression = true,
ResourcePool = FanartArtistProvider.Current.FanArtResourcePool
diff --git a/MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs b/MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs
index 13920d942..567f3b5da 100644
--- a/MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs
+++ b/MediaBrowser.Providers/TV/FanArtTvUpdatesPostScanTask.cs
@@ -105,10 +105,17 @@ namespace MediaBrowser.Providers.TV
/// <returns>Task{IEnumerable{System.String}}.</returns>
private async Task<IEnumerable<string>> GetSeriesIdsToUpdate(IEnumerable<string> existingSeriesIds, string lastUpdateTime, CancellationToken cancellationToken)
{
+ var url = string.Format(UpdatesUrl, FanartArtistProvider.ApiKey, lastUpdateTime);
+
+ if (!string.IsNullOrWhiteSpace(_config.Configuration.FanartApiKey))
+ {
+ url += "&client_key=" + _config.Configuration.FanartApiKey;
+ }
+
// First get last time
using (var stream = await _httpClient.Get(new HttpRequestOptions
{
- Url = string.Format(UpdatesUrl, FanartArtistProvider.ApiKey, lastUpdateTime),
+ Url = url,
CancellationToken = cancellationToken,
EnableHttpCompression = true,
ResourcePool = FanartArtistProvider.Current.FanArtResourcePool
diff --git a/MediaBrowser.Providers/TV/FanartSeriesProvider.cs b/MediaBrowser.Providers/TV/FanartSeriesProvider.cs
index 8ba25e9f1..f95b6b2c6 100644
--- a/MediaBrowser.Providers/TV/FanartSeriesProvider.cs
+++ b/MediaBrowser.Providers/TV/FanartSeriesProvider.cs
@@ -295,6 +295,11 @@ namespace MediaBrowser.Providers.TV
var url = string.Format(FanArtBaseUrl, FanartArtistProvider.ApiKey, tvdbId);
+ if (!string.IsNullOrWhiteSpace(_config.Configuration.FanartApiKey))
+ {
+ url += "&client_key=" + _config.Configuration.FanartApiKey;
+ }
+
var path = GetFanartJsonPath(tvdbId);
Directory.CreateDirectory(Path.GetDirectoryName(path));
diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json
index 1935fba93..e3add2f19 100644
--- a/MediaBrowser.Server.Implementations/Localization/Server/server.json
+++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json
@@ -314,12 +314,14 @@
"OptionEpisodes": "Episodes",
"OptionOtherVideos": "Other Videos",
"TitleMetadata": "Metadata",
- "LabelAutomaticUpdatesFanart": "Enable automatic updates from FanArt.tv",
+ "LabelAutomaticUpdates": "Enable automatic updates",
"LabelAutomaticUpdatesTmdb": "Enable automatic updates from TheMovieDB.org",
"LabelAutomaticUpdatesTvdb": "Enable automatic updates from TheTVDB.com",
"LabelAutomaticUpdatesFanartHelp": "If enabled, new images will be downloaded automatically as they're added to fanart.tv. Existing images will not be replaced.",
"LabelAutomaticUpdatesTmdbHelp": "If enabled, new images will be downloaded automatically as they're added to TheMovieDB.org. Existing images will not be replaced.",
"LabelAutomaticUpdatesTvdbHelp": "If enabled, new images will be downloaded automatically as they're added to TheTVDB.com. Existing images will not be replaced.",
+ "LabelFanartApiKey": "Personal api key:",
+ "LabelFanartApiKeyHelp": "Requests to fanart without a personal API key return results that were approved over 7 days ago. With a personal API key that drops to 48 hours and if you are also a fanart VIP member that will further drop to around 10 minutes.",
"ExtractChapterImagesHelp": "Extracting chapter images will allow clients to display graphical scene selection menus. The process can be slow, cpu-intensive and may require several gigabytes of space. It runs when videos are discovered, and also as a nightly scheduled task at 4am. The schedule is configurable in the scheduled tasks area. It is not recommended to run this task during peak usage hours.",
"LabelMetadataDownloadLanguage": "Preferred download language:",
"ButtonAutoScroll": "Auto-scroll",