mirror of
https://github.com/Readarr/Readarr
synced 2025-12-30 20:25:18 +01:00
New: Link to "Why Searches Could be Failing" wiki section
This commit is contained in:
parent
05d0fe2da6
commit
6b6ff4fe76
3 changed files with 22 additions and 8 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import Alert from 'Components/Alert';
|
||||
import TextInput from 'Components/Form/TextInput';
|
||||
import Icon from 'Components/Icon';
|
||||
import Button from 'Components/Link/Button';
|
||||
|
|
@ -7,7 +8,7 @@ import Link from 'Components/Link/Link';
|
|||
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
||||
import PageContent from 'Components/Page/PageContent';
|
||||
import PageContentBody from 'Components/Page/PageContentBody';
|
||||
import { icons } from 'Helpers/Props';
|
||||
import { icons, kinds } from 'Helpers/Props';
|
||||
import getErrorMessage from 'Utilities/Object/getErrorMessage';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import AddNewAuthorSearchResultConnector from './Author/AddNewAuthorSearchResultConnector';
|
||||
|
|
@ -127,9 +128,16 @@ class AddNewItem extends Component {
|
|||
!isFetching && !!error ?
|
||||
<div className={styles.message}>
|
||||
<div className={styles.helpText}>
|
||||
Failed to load search results, please try again.
|
||||
{translate('FailedLoadingSearchResults')}
|
||||
</div>
|
||||
|
||||
<Alert kind={kinds.WARNING}>{getErrorMessage(error)}</Alert>
|
||||
|
||||
<div>
|
||||
<Link to="https://wiki.servarr.com/readarr/troubleshooting#invalid-response-received-from-metadata-api">
|
||||
{translate('WhySearchesCouldBeFailing')}
|
||||
</Link>
|
||||
</div>
|
||||
<div>{getErrorMessage(error)}</div>
|
||||
</div> : null
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -348,6 +348,7 @@
|
|||
"ExtraFileExtensionsHelpText": "Comma separated list of extra files to import (.nfo will be imported as .nfo-orig)",
|
||||
"ExtraFileExtensionsHelpTextsExamples": "Examples: '.sub, .nfo' or 'sub,nfo'",
|
||||
"FailedDownloadHandling": "Failed Download Handling",
|
||||
"FailedLoadingSearchResults": "Failed to load search results, please try again.",
|
||||
"FailedToLoadQueue": "Failed to load Queue",
|
||||
"FileDateHelpText": "Change file date on import/rescan",
|
||||
"FileDetails": "File Details",
|
||||
|
|
@ -1073,6 +1074,7 @@
|
|||
"WatchRootFoldersForFileChanges": "Watch Root Folders for file changes",
|
||||
"WeekColumnHeader": "Week Column Header",
|
||||
"WhatsNew": "What's New?",
|
||||
"WhySearchesCouldBeFailing": "Click here to find out why searches could be failing",
|
||||
"WouldYouLikeToRestoreBackup": "Would you like to restore the backup '{name}'?",
|
||||
"WriteAudioTags": "Tag Audio Files with Metadata",
|
||||
"WriteAudioTagsScrub": "Scrub Existing Tags",
|
||||
|
|
|
|||
|
|
@ -218,13 +218,12 @@ public List<Book> SearchForNewBook(string title, string author, bool getAllEditi
|
|||
catch (HttpException ex)
|
||||
{
|
||||
_logger.Warn(ex, ex.Message);
|
||||
throw new GoodreadsException("Search for '{0}' failed. Unable to communicate with Goodreads.", title);
|
||||
throw new GoodreadsException("Search for '{0}' failed. Unable to communicate with Goodreads.", ex, title);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception ex) when (ex is not BookInfoException)
|
||||
{
|
||||
_logger.Warn(ex, ex.Message);
|
||||
throw new GoodreadsException("Search for '{0}' failed. Invalid response received from Goodreads.",
|
||||
title);
|
||||
throw new GoodreadsException("Search for '{0}' failed. Invalid response received from Goodreads.", ex, title);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -296,6 +295,11 @@ private List<Book> Search(string query, bool getAllEditions)
|
|||
{
|
||||
return MapSearchResult(ids);
|
||||
}
|
||||
catch (HttpException ex)
|
||||
{
|
||||
_logger.Warn(ex);
|
||||
throw new BookInfoException("Search for '{0}' failed. Unable to communicate with ReadarrAPI, returning status code: {1}.", ex, query, ex.Response.StatusCode);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Warn(e, "Error mapping search results");
|
||||
|
|
@ -484,7 +488,7 @@ private List<Book> MapSearchResult(List<int> ids)
|
|||
httpRequest.ContentSummary = ids.ToJson(Formatting.None);
|
||||
|
||||
httpRequest.AllowAutoRedirect = true;
|
||||
httpRequest.SuppressHttpError = true;
|
||||
httpRequest.SuppressHttpErrorStatusCodes = new[] { HttpStatusCode.TooManyRequests };
|
||||
|
||||
httpResponse = _httpClient.Post<BulkBookResource>(httpRequest);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue