adjust provider caching
This commit is contained in:
parent
788d302e41
commit
b5a7483fcc
|
@ -297,12 +297,6 @@ namespace MediaBrowser.Providers.Music
|
||||||
ResourcePool = _musicBrainzResourcePool
|
ResourcePool = _musicBrainzResourcePool
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!isSearch)
|
|
||||||
{
|
|
||||||
options.CacheMode = CacheMode.Unconditional;
|
|
||||||
options.CacheLength = TimeSpan.FromDays(3);
|
|
||||||
}
|
|
||||||
|
|
||||||
using (var xml = await _httpClient.Get(options).ConfigureAwait(false))
|
using (var xml = await _httpClient.Get(options).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
using (var oReader = new StreamReader(xml, Encoding.UTF8))
|
using (var oReader = new StreamReader(xml, Encoding.UTF8))
|
||||||
|
|
|
@ -99,9 +99,7 @@ namespace MediaBrowser.Providers.Omdb
|
||||||
{
|
{
|
||||||
Url = url,
|
Url = url,
|
||||||
ResourcePool = OmdbProvider.ResourcePool,
|
ResourcePool = OmdbProvider.ResourcePool,
|
||||||
CancellationToken = cancellationToken,
|
CancellationToken = cancellationToken
|
||||||
CacheMode = CacheMode.Unconditional,
|
|
||||||
CacheLength = TimeSpan.FromDays(2)
|
|
||||||
|
|
||||||
}).ConfigureAwait(false))
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
|
@ -133,7 +131,7 @@ namespace MediaBrowser.Providers.Omdb
|
||||||
item.SetProviderId(MetadataProviders.Imdb, result.imdbID);
|
item.SetProviderId(MetadataProviders.Imdb, result.imdbID);
|
||||||
|
|
||||||
int parsedYear;
|
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))
|
&& int.TryParse(result.Year.Substring(0, Math.Min(result.Year.Length, 4)), NumberStyles.Any, CultureInfo.InvariantCulture, out parsedYear))
|
||||||
{
|
{
|
||||||
item.ProductionYear = parsedYear;
|
item.ProductionYear = parsedYear;
|
||||||
|
|
|
@ -43,9 +43,7 @@ namespace MediaBrowser.Providers.Omdb
|
||||||
{
|
{
|
||||||
Url = url,
|
Url = url,
|
||||||
ResourcePool = ResourcePool,
|
ResourcePool = ResourcePool,
|
||||||
CancellationToken = cancellationToken,
|
CancellationToken = cancellationToken
|
||||||
CacheMode = CacheMode.Unconditional,
|
|
||||||
CacheLength = TimeSpan.FromDays(7)
|
|
||||||
|
|
||||||
}).ConfigureAwait(false))
|
}).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user