From b5a7483fcc7504b90cac133f5432ab89148b2ae3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 12 Nov 2015 13:42:16 -0500 Subject: [PATCH] adjust provider caching --- MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs | 6 ------ MediaBrowser.Providers/Omdb/OmdbItemProvider.cs | 6 ++---- MediaBrowser.Providers/Omdb/OmdbProvider.cs | 4 +--- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs b/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs index 978d611a8c..e73a98b6f9 100644 --- a/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs +++ b/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs @@ -297,12 +297,6 @@ namespace MediaBrowser.Providers.Music ResourcePool = _musicBrainzResourcePool }; - if (!isSearch) - { - options.CacheMode = CacheMode.Unconditional; - options.CacheLength = TimeSpan.FromDays(3); - } - using (var xml = await _httpClient.Get(options).ConfigureAwait(false)) { using (var oReader = new StreamReader(xml, Encoding.UTF8)) diff --git a/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs b/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs index c1ec5061d6..efcc76e694 100644 --- a/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs @@ -99,9 +99,7 @@ namespace MediaBrowser.Providers.Omdb { Url = url, ResourcePool = OmdbProvider.ResourcePool, - CancellationToken = cancellationToken, - CacheMode = CacheMode.Unconditional, - CacheLength = TimeSpan.FromDays(2) + CancellationToken = cancellationToken }).ConfigureAwait(false)) { @@ -133,7 +131,7 @@ namespace MediaBrowser.Providers.Omdb item.SetProviderId(MetadataProviders.Imdb, result.imdbID); int parsedYear; - if (result.Year.Length > 0 + if (result.Year.Length > 0 && int.TryParse(result.Year.Substring(0, Math.Min(result.Year.Length, 4)), NumberStyles.Any, CultureInfo.InvariantCulture, out parsedYear)) { item.ProductionYear = parsedYear; diff --git a/MediaBrowser.Providers/Omdb/OmdbProvider.cs b/MediaBrowser.Providers/Omdb/OmdbProvider.cs index c7ce57fca4..b68f93cf6b 100644 --- a/MediaBrowser.Providers/Omdb/OmdbProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbProvider.cs @@ -43,9 +43,7 @@ namespace MediaBrowser.Providers.Omdb { Url = url, ResourcePool = ResourcePool, - CancellationToken = cancellationToken, - CacheMode = CacheMode.Unconditional, - CacheLength = TimeSpan.FromDays(7) + CancellationToken = cancellationToken }).ConfigureAwait(false)) {