mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
New: Refresh button on book page that bypasses cache
This commit is contained in:
@@ -117,6 +117,7 @@ class BookDetails extends Component {
|
||||
images,
|
||||
links,
|
||||
isSaving,
|
||||
isRefreshing,
|
||||
isFetching,
|
||||
isPopulated,
|
||||
bookFilesError,
|
||||
@@ -127,6 +128,7 @@ class BookDetails extends Component {
|
||||
nextBook,
|
||||
isSearching,
|
||||
onMonitorTogglePress,
|
||||
onRefreshPress,
|
||||
onSearchPress
|
||||
} = this.props;
|
||||
|
||||
@@ -142,6 +144,15 @@ class BookDetails extends Component {
|
||||
<PageContent title={title}>
|
||||
<PageToolbar>
|
||||
<PageToolbarSection>
|
||||
<PageToolbarButton
|
||||
label="Refresh"
|
||||
iconName={icons.REFRESH}
|
||||
spinningName={icons.REFRESH}
|
||||
title="Refresh information"
|
||||
isSpinning={isRefreshing}
|
||||
onPress={onRefreshPress}
|
||||
/>
|
||||
|
||||
<PageToolbarButton
|
||||
label="Search Book"
|
||||
iconName={icons.SEARCH}
|
||||
@@ -473,6 +484,7 @@ BookDetails.propTypes = {
|
||||
monitored: PropTypes.bool.isRequired,
|
||||
shortDateFormat: PropTypes.string.isRequired,
|
||||
isSaving: PropTypes.bool.isRequired,
|
||||
isRefreshing: PropTypes.bool,
|
||||
isSearching: PropTypes.bool,
|
||||
isFetching: PropTypes.bool,
|
||||
isPopulated: PropTypes.bool,
|
||||
|
||||
@@ -70,6 +70,12 @@ function createMapStateToProps() {
|
||||
isSearchingCommand.body.bookIds.indexOf(book.id) > -1
|
||||
);
|
||||
|
||||
const isRefreshingCommand = findCommand(commands, { name: commandNames.REFRESH_BOOK });
|
||||
const isRefreshing = (
|
||||
isCommandExecuting(isRefreshingCommand) &&
|
||||
isRefreshingCommand.body.bookId === book.id
|
||||
);
|
||||
|
||||
const isFetching = isBookFilesFetching;
|
||||
const isPopulated = isBookFilesPopulated;
|
||||
|
||||
@@ -77,6 +83,7 @@ function createMapStateToProps() {
|
||||
...book,
|
||||
shortDateFormat: uiSettings.shortDateFormat,
|
||||
author,
|
||||
isRefreshing,
|
||||
isSearching,
|
||||
isFetching,
|
||||
isPopulated,
|
||||
@@ -147,6 +154,13 @@ class BookDetailsConnector extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
onRefreshPress = () => {
|
||||
this.props.executeCommand({
|
||||
name: commandNames.REFRESH_BOOK,
|
||||
bookId: this.props.id
|
||||
});
|
||||
}
|
||||
|
||||
onSearchPress = () => {
|
||||
this.props.executeCommand({
|
||||
name: commandNames.BOOK_SEARCH,
|
||||
@@ -162,6 +176,7 @@ class BookDetailsConnector extends Component {
|
||||
<BookDetails
|
||||
{...this.props}
|
||||
onMonitorTogglePress={this.onMonitorTogglePress}
|
||||
onRefreshPress={this.onRefreshPress}
|
||||
onSearchPress={this.onSearchPress}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user