adjust provider caching

This commit is contained in:
Luke Pulverenti 2015-11-12 13:42:16 -05:00
parent 788d302e41
commit b5a7483fcc
3 changed files with 3 additions and 13 deletions

View File

@ -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))

View File

@ -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;

View File

@ -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))
{