New: Refresh button on book page that bypasses cache

This commit is contained in:
ta264
2020-09-03 21:35:49 +01:00
parent b93bc1e5e5
commit 2f8ac793ff
11 changed files with 97 additions and 18 deletions
@@ -73,7 +73,7 @@ namespace NzbDrone.Core.MetadataSource.Goodreads
return null;
}
public Author GetAuthorInfo(string foreignAuthorId)
public Author GetAuthorInfo(string foreignAuthorId, bool useCache = true)
{
_logger.Debug("Getting Author details GoodreadsId of {0}", foreignAuthorId);
@@ -85,7 +85,7 @@ namespace NzbDrone.Core.MetadataSource.Goodreads
httpRequest.AllowAutoRedirect = true;
httpRequest.SuppressHttpError = true;
var httpResponse = _cachedHttpClient.Get(httpRequest, TimeSpan.FromDays(30));
var httpResponse = _cachedHttpClient.Get(httpRequest, useCache, TimeSpan.FromDays(30));
if (httpResponse.HasHttpError)
{
@@ -217,7 +217,7 @@ namespace NzbDrone.Core.MetadataSource.Goodreads
httpRequest.AllowAutoRedirect = true;
httpRequest.SuppressHttpError = true;
var httpResponse = _cachedHttpClient.Get(httpRequest, TimeSpan.FromDays(7));
var httpResponse = _cachedHttpClient.Get(httpRequest, true, TimeSpan.FromDays(7));
if (httpResponse.HasHttpError)
{
@@ -249,7 +249,7 @@ namespace NzbDrone.Core.MetadataSource.Goodreads
httpRequest.AllowAutoRedirect = true;
httpRequest.SuppressHttpError = true;
var httpResponse = _cachedHttpClient.Get(httpRequest, TimeSpan.FromDays(90));
var httpResponse = _cachedHttpClient.Get(httpRequest, true, TimeSpan.FromDays(90));
if (httpResponse.HasHttpError)
{
@@ -311,7 +311,7 @@ namespace NzbDrone.Core.MetadataSource.Goodreads
return null;
}
public Tuple<string, Book, List<AuthorMetadata>> GetBookInfo(string foreignEditionId)
public Tuple<string, Book, List<AuthorMetadata>> GetBookInfo(string foreignEditionId, bool useCache = true)
{
_logger.Debug("Getting Book with GoodreadsId of {0}", foreignEditionId);
@@ -323,7 +323,7 @@ namespace NzbDrone.Core.MetadataSource.Goodreads
httpRequest.AllowAutoRedirect = true;
httpRequest.SuppressHttpError = true;
var httpResponse = _cachedHttpClient.Get(httpRequest, TimeSpan.FromDays(90));
var httpResponse = _cachedHttpClient.Get(httpRequest, useCache, TimeSpan.FromDays(90));
if (httpResponse.HasHttpError)
{