mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
Renames in Frontend
This commit is contained in:
@@ -42,7 +42,7 @@ class Queue extends Component {
|
||||
|
||||
shouldComponentUpdate(nextProps) {
|
||||
// Don't update when fetching has completed if items have changed,
|
||||
// before albums start fetching or when albums start fetching.
|
||||
// before books start fetching or when books start fetching.
|
||||
|
||||
if (
|
||||
this.props.isFetching &&
|
||||
@@ -53,7 +53,7 @@ class Queue extends Component {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.props.isAlbumsFetching && nextProps.isAlbumsFetching) {
|
||||
if (!this.props.isBooksFetching && nextProps.isBooksFetching) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -125,9 +125,9 @@ class Queue extends Component {
|
||||
isPopulated,
|
||||
error,
|
||||
items,
|
||||
isAlbumsFetching,
|
||||
isAlbumsPopulated,
|
||||
albumsError,
|
||||
isBooksFetching,
|
||||
isBooksPopulated,
|
||||
booksError,
|
||||
columns,
|
||||
totalRecords,
|
||||
isGrabbing,
|
||||
@@ -145,9 +145,9 @@ class Queue extends Component {
|
||||
isPendingSelected
|
||||
} = this.state;
|
||||
|
||||
const isRefreshing = isFetching || isAlbumsFetching || isRefreshMonitoredDownloadsExecuting;
|
||||
const isAllPopulated = isPopulated && (isAlbumsPopulated || !items.length || items.every((e) => !e.bookId));
|
||||
const hasError = error || albumsError;
|
||||
const isRefreshing = isFetching || isBooksFetching || isRefreshMonitoredDownloadsExecuting;
|
||||
const isAllPopulated = isPopulated && (isBooksPopulated || !items.length || items.every((e) => !e.bookId));
|
||||
const hasError = error || booksError;
|
||||
const selectedIds = this.getSelectedIds();
|
||||
const selectedCount = selectedIds.length;
|
||||
const disableSelectedActions = selectedCount === 0;
|
||||
@@ -280,9 +280,9 @@ Queue.propTypes = {
|
||||
isPopulated: PropTypes.bool.isRequired,
|
||||
error: PropTypes.object,
|
||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
isAlbumsFetching: PropTypes.bool.isRequired,
|
||||
isAlbumsPopulated: PropTypes.bool.isRequired,
|
||||
albumsError: PropTypes.object,
|
||||
isBooksFetching: PropTypes.bool.isRequired,
|
||||
isBooksPopulated: PropTypes.bool.isRequired,
|
||||
booksError: PropTypes.object,
|
||||
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
totalRecords: PropTypes.number,
|
||||
isGrabbing: PropTypes.bool.isRequired,
|
||||
|
||||
@@ -9,21 +9,21 @@ import withCurrentPage from 'Components/withCurrentPage';
|
||||
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
|
||||
import { executeCommand } from 'Store/Actions/commandActions';
|
||||
import * as queueActions from 'Store/Actions/queueActions';
|
||||
import { fetchAlbums, clearAlbums } from 'Store/Actions/albumActions';
|
||||
import { fetchBooks, clearBooks } from 'Store/Actions/bookActions';
|
||||
import * as commandNames from 'Commands/commandNames';
|
||||
import Queue from './Queue';
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
(state) => state.albums,
|
||||
(state) => state.books,
|
||||
(state) => state.queue.options,
|
||||
(state) => state.queue.paged,
|
||||
createCommandExecutingSelector(commandNames.REFRESH_MONITORED_DOWNLOADS),
|
||||
(albums, options, queue, isRefreshMonitoredDownloadsExecuting) => {
|
||||
(books, options, queue, isRefreshMonitoredDownloadsExecuting) => {
|
||||
return {
|
||||
isAlbumsFetching: albums.isFetching,
|
||||
isAlbumsPopulated: albums.isPopulated,
|
||||
albumsError: albums.error,
|
||||
isBooksFetching: books.isFetching,
|
||||
isBooksPopulated: books.isPopulated,
|
||||
booksError: books.error,
|
||||
isRefreshMonitoredDownloadsExecuting,
|
||||
...options,
|
||||
...queue
|
||||
@@ -34,8 +34,8 @@ function createMapStateToProps() {
|
||||
|
||||
const mapDispatchToProps = {
|
||||
...queueActions,
|
||||
fetchAlbums,
|
||||
clearAlbums,
|
||||
fetchBooks,
|
||||
clearBooks,
|
||||
executeCommand
|
||||
};
|
||||
|
||||
@@ -65,15 +65,15 @@ class QueueConnector extends Component {
|
||||
const bookIds = selectUniqueIds(this.props.items, 'bookId');
|
||||
|
||||
if (bookIds.length) {
|
||||
this.props.fetchAlbums({ bookIds });
|
||||
this.props.fetchBooks({ bookIds });
|
||||
} else {
|
||||
this.props.clearAlbums();
|
||||
this.props.clearBooks();
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
this.props.includeUnknownArtistItems !==
|
||||
prevProps.includeUnknownArtistItems
|
||||
this.props.includeUnknownAuthorItems !==
|
||||
prevProps.includeUnknownAuthorItems
|
||||
) {
|
||||
this.repopulate();
|
||||
}
|
||||
@@ -82,7 +82,7 @@ class QueueConnector extends Component {
|
||||
componentWillUnmount() {
|
||||
unregisterPagePopulator(this.repopulate);
|
||||
this.props.clearQueue();
|
||||
this.props.clearAlbums();
|
||||
this.props.clearBooks();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -166,7 +166,7 @@ class QueueConnector extends Component {
|
||||
QueueConnector.propTypes = {
|
||||
useCurrentPage: PropTypes.bool.isRequired,
|
||||
items: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
includeUnknownArtistItems: PropTypes.bool.isRequired,
|
||||
includeUnknownAuthorItems: PropTypes.bool.isRequired,
|
||||
fetchQueue: PropTypes.func.isRequired,
|
||||
gotoQueueFirstPage: PropTypes.func.isRequired,
|
||||
gotoQueuePreviousPage: PropTypes.func.isRequired,
|
||||
@@ -178,8 +178,8 @@ QueueConnector.propTypes = {
|
||||
clearQueue: PropTypes.func.isRequired,
|
||||
grabQueueItems: PropTypes.func.isRequired,
|
||||
removeQueueItems: PropTypes.func.isRequired,
|
||||
fetchAlbums: PropTypes.func.isRequired,
|
||||
clearAlbums: PropTypes.func.isRequired,
|
||||
fetchBooks: PropTypes.func.isRequired,
|
||||
clearBooks: PropTypes.func.isRequired,
|
||||
executeCommand: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ function QueueDetails(props) {
|
||||
return (
|
||||
<Icon
|
||||
name={icons.DOWNLOADING}
|
||||
title={`Album is downloading - ${progress.toFixed(1)}% ${title}`}
|
||||
title={`Book is downloading - ${progress.toFixed(1)}% ${title}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,18 +14,18 @@ class QueueOptions extends Component {
|
||||
super(props, context);
|
||||
|
||||
this.state = {
|
||||
includeUnknownArtistItems: props.includeUnknownArtistItems
|
||||
includeUnknownAuthorItems: props.includeUnknownAuthorItems
|
||||
};
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
const {
|
||||
includeUnknownArtistItems
|
||||
includeUnknownAuthorItems
|
||||
} = this.props;
|
||||
|
||||
if (includeUnknownArtistItems !== prevProps.includeUnknownArtistItems) {
|
||||
if (includeUnknownAuthorItems !== prevProps.includeUnknownAuthorItems) {
|
||||
this.setState({
|
||||
includeUnknownArtistItems
|
||||
includeUnknownAuthorItems
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -48,19 +48,19 @@ class QueueOptions extends Component {
|
||||
|
||||
render() {
|
||||
const {
|
||||
includeUnknownArtistItems
|
||||
includeUnknownAuthorItems
|
||||
} = this.state;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<FormGroup>
|
||||
<FormLabel>Show Unknown Artist Items</FormLabel>
|
||||
<FormLabel>Show Unknown Author Items</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="includeUnknownArtistItems"
|
||||
value={includeUnknownArtistItems}
|
||||
helpText="Show items without a artist in the queue, this could include removed artists, movies or anything else in Readarr's category"
|
||||
name="includeUnknownAuthorItems"
|
||||
value={includeUnknownAuthorItems}
|
||||
helpText="Show items without a author in the queue, this could include removed authors, movies or anything else in Readarr's category"
|
||||
onChange={this.onOptionChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
@@ -70,7 +70,7 @@ class QueueOptions extends Component {
|
||||
}
|
||||
|
||||
QueueOptions.propTypes = {
|
||||
includeUnknownArtistItems: PropTypes.bool.isRequired,
|
||||
includeUnknownAuthorItems: PropTypes.bool.isRequired,
|
||||
onOptionChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ import TableSelectCell from 'Components/Table/Cells/TableSelectCell';
|
||||
import Icon from 'Components/Icon';
|
||||
import Popover from 'Components/Tooltip/Popover';
|
||||
import ProtocolLabel from 'Activity/Queue/ProtocolLabel';
|
||||
import AlbumTitleLink from 'Album/AlbumTitleLink';
|
||||
import TrackQuality from 'Album/TrackQuality';
|
||||
import BookTitleLink from 'Book/BookTitleLink';
|
||||
import BookQuality from 'Book/BookQuality';
|
||||
import InteractiveImportModal from 'InteractiveImport/InteractiveImportModal';
|
||||
import ArtistNameLink from 'Artist/ArtistNameLink';
|
||||
import AuthorNameLink from 'Author/AuthorNameLink';
|
||||
import QueueStatusCell from './QueueStatusCell';
|
||||
import TimeleftCell from './TimeleftCell';
|
||||
import RemoveQueueItemModal from './RemoveQueueItemModal';
|
||||
@@ -71,8 +71,8 @@ class QueueRow extends Component {
|
||||
trackedDownloadState,
|
||||
statusMessages,
|
||||
errorMessage,
|
||||
artist,
|
||||
album,
|
||||
author,
|
||||
book,
|
||||
quality,
|
||||
protocol,
|
||||
indexer,
|
||||
@@ -141,10 +141,10 @@ class QueueRow extends Component {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
{
|
||||
artist ?
|
||||
<ArtistNameLink
|
||||
titleSlug={artist.titleSlug}
|
||||
artistName={artist.artistName}
|
||||
author ?
|
||||
<AuthorNameLink
|
||||
titleSlug={author.titleSlug}
|
||||
authorName={author.authorName}
|
||||
/> :
|
||||
title
|
||||
}
|
||||
@@ -156,11 +156,11 @@ class QueueRow extends Component {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
{
|
||||
album ?
|
||||
<AlbumTitleLink
|
||||
titleSlug={album.titleSlug}
|
||||
title={album.title}
|
||||
disambiguation={album.disambiguation}
|
||||
book ?
|
||||
<BookTitleLink
|
||||
titleSlug={book.titleSlug}
|
||||
title={book.title}
|
||||
disambiguation={book.disambiguation}
|
||||
/> :
|
||||
'-'
|
||||
}
|
||||
@@ -169,11 +169,11 @@ class QueueRow extends Component {
|
||||
}
|
||||
|
||||
if (name === 'books.releaseDate') {
|
||||
if (album) {
|
||||
if (book) {
|
||||
return (
|
||||
<RelativeDateCellConnector
|
||||
key={name}
|
||||
date={album.releaseDate}
|
||||
date={book.releaseDate}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -188,7 +188,7 @@ class QueueRow extends Component {
|
||||
if (name === 'quality') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
<TrackQuality
|
||||
<BookQuality
|
||||
quality={quality}
|
||||
/>
|
||||
</TableRowCell>
|
||||
@@ -335,7 +335,7 @@ class QueueRow extends Component {
|
||||
<RemoveQueueItemModal
|
||||
isOpen={isRemoveQueueItemModalOpen}
|
||||
sourceTitle={title}
|
||||
canIgnore={!!(artist && album)}
|
||||
canIgnore={!!(author && book)}
|
||||
onRemovePress={this.onRemoveQueueItemModalConfirmed}
|
||||
onModalClose={this.onRemoveQueueItemModalClose}
|
||||
/>
|
||||
@@ -354,8 +354,8 @@ QueueRow.propTypes = {
|
||||
trackedDownloadState: PropTypes.string,
|
||||
statusMessages: PropTypes.arrayOf(PropTypes.object),
|
||||
errorMessage: PropTypes.string,
|
||||
artist: PropTypes.object,
|
||||
album: PropTypes.object,
|
||||
author: PropTypes.object,
|
||||
book: PropTypes.object,
|
||||
quality: PropTypes.object.isRequired,
|
||||
protocol: PropTypes.string.isRequired,
|
||||
indexer: PropTypes.string,
|
||||
|
||||
@@ -4,25 +4,25 @@ import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { grabQueueItem, removeQueueItem } from 'Store/Actions/queueActions';
|
||||
import createArtistSelector from 'Store/Selectors/createArtistSelector';
|
||||
import createAlbumSelector from 'Store/Selectors/createAlbumSelector';
|
||||
import createAuthorSelector from 'Store/Selectors/createAuthorSelector';
|
||||
import createBookSelector from 'Store/Selectors/createBookSelector';
|
||||
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
|
||||
import QueueRow from './QueueRow';
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
createArtistSelector(),
|
||||
createAlbumSelector(),
|
||||
createAuthorSelector(),
|
||||
createBookSelector(),
|
||||
createUISettingsSelector(),
|
||||
(artist, album, uiSettings) => {
|
||||
(author, book, uiSettings) => {
|
||||
const result = _.pick(uiSettings, [
|
||||
'showRelativeDates',
|
||||
'shortDateFormat',
|
||||
'timeFormat'
|
||||
]);
|
||||
|
||||
result.artist = artist;
|
||||
result.album = album;
|
||||
result.author = author;
|
||||
result.book = book;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ class QueueRowConnector extends Component {
|
||||
|
||||
QueueRowConnector.propTypes = {
|
||||
id: PropTypes.number.isRequired,
|
||||
album: PropTypes.object,
|
||||
book: PropTypes.object,
|
||||
grabQueueItem: PropTypes.func.isRequired,
|
||||
removeQueueItem: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
@@ -9,8 +9,8 @@ function createMapStateToProps() {
|
||||
return createSelector(
|
||||
(state) => state.app,
|
||||
(state) => state.queue.status,
|
||||
(state) => state.queue.options.includeUnknownArtistItems,
|
||||
(app, status, includeUnknownArtistItems) => {
|
||||
(state) => state.queue.options.includeUnknownAuthorItems,
|
||||
(app, status, includeUnknownAuthorItems) => {
|
||||
const {
|
||||
errors,
|
||||
warnings,
|
||||
@@ -25,9 +25,9 @@ function createMapStateToProps() {
|
||||
isReconnecting: app.isReconnecting,
|
||||
isPopulated: status.isPopulated,
|
||||
...status.item,
|
||||
count: includeUnknownArtistItems ? totalCount : count,
|
||||
errors: includeUnknownArtistItems ? errors || unknownErrors : errors,
|
||||
warnings: includeUnknownArtistItems ? warnings || unknownWarnings : warnings
|
||||
count: includeUnknownAuthorItems ? totalCount : count,
|
||||
errors: includeUnknownAuthorItems ? errors || unknownErrors : errors,
|
||||
warnings: includeUnknownAuthorItems ? warnings || unknownWarnings : warnings
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user