mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
New: Readarr 0.1
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import { icons, kinds } from 'Helpers/Props';
|
||||
import IconButton from 'Components/Link/IconButton';
|
||||
@@ -67,11 +68,11 @@ class BlacklistRow extends Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (name === 'artist.sortName') {
|
||||
if (name === 'authors.sortName') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
<ArtistNameLink
|
||||
foreignArtistId={artist.foreignArtistId}
|
||||
titleSlug={artist.titleSlug}
|
||||
artistName={artist.artistName}
|
||||
/>
|
||||
</TableRowCell>
|
||||
|
||||
@@ -61,10 +61,10 @@ class HistoryConnector extends Component {
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
if (hasDifferentItems(prevProps.items, this.props.items)) {
|
||||
const albumIds = selectUniqueIds(this.props.items, 'albumId');
|
||||
const bookIds = selectUniqueIds(this.props.items, 'bookId');
|
||||
const trackIds = selectUniqueIds(this.props.items, 'trackId');
|
||||
if (albumIds.length) {
|
||||
this.props.fetchAlbums({ albumIds });
|
||||
if (bookIds.length) {
|
||||
this.props.fetchAlbums({ bookIds });
|
||||
} else {
|
||||
this.props.clearAlbums();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ class HistoryRow extends Component {
|
||||
const {
|
||||
artist,
|
||||
album,
|
||||
track,
|
||||
quality,
|
||||
qualityCutoffNotMet,
|
||||
eventType,
|
||||
@@ -94,22 +93,22 @@ class HistoryRow extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'artist.sortName') {
|
||||
if (name === 'authors.sortName') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
<ArtistNameLink
|
||||
foreignArtistId={artist.foreignArtistId}
|
||||
titleSlug={artist.titleSlug}
|
||||
artistName={artist.artistName}
|
||||
/>
|
||||
</TableRowCell>
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'album.title') {
|
||||
if (name === 'books.title') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
<AlbumTitleLink
|
||||
foreignAlbumId={album.foreignAlbumId}
|
||||
titleSlug={album.titleSlug}
|
||||
title={album.title}
|
||||
disambiguation={album.disambiguation}
|
||||
/>
|
||||
@@ -117,14 +116,6 @@ class HistoryRow extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'trackTitle') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
{track.title}
|
||||
</TableRowCell>
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'quality') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
@@ -214,10 +205,9 @@ class HistoryRow extends Component {
|
||||
}
|
||||
|
||||
HistoryRow.propTypes = {
|
||||
albumId: PropTypes.number,
|
||||
bookId: PropTypes.number,
|
||||
artist: PropTypes.object.isRequired,
|
||||
album: PropTypes.object,
|
||||
track: PropTypes.object,
|
||||
quality: PropTypes.object.isRequired,
|
||||
qualityCutoffNotMet: PropTypes.bool.isRequired,
|
||||
eventType: PropTypes.string.isRequired,
|
||||
@@ -232,10 +222,4 @@ HistoryRow.propTypes = {
|
||||
onMarkAsFailedPress: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
HistoryRow.defaultProps = {
|
||||
track: {
|
||||
title: ''
|
||||
}
|
||||
};
|
||||
|
||||
export default HistoryRow;
|
||||
|
||||
@@ -48,7 +48,7 @@ class Queue extends Component {
|
||||
this.props.isFetching &&
|
||||
nextProps.isPopulated &&
|
||||
hasDifferentItems(this.props.items, nextProps.items) &&
|
||||
nextProps.items.some((e) => e.albumId)
|
||||
nextProps.items.some((e) => e.bookId)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ class Queue extends Component {
|
||||
} = this.state;
|
||||
|
||||
const isRefreshing = isFetching || isAlbumsFetching || isRefreshMonitoredDownloadsExecuting;
|
||||
const isAllPopulated = isPopulated && (isAlbumsPopulated || !items.length || items.every((e) => !e.albumId));
|
||||
const isAllPopulated = isPopulated && (isAlbumsPopulated || !items.length || items.every((e) => !e.bookId));
|
||||
const hasError = error || albumsError;
|
||||
const selectedIds = this.getSelectedIds();
|
||||
const selectedCount = selectedIds.length;
|
||||
@@ -236,7 +236,7 @@ class Queue extends Component {
|
||||
return (
|
||||
<QueueRowConnector
|
||||
key={item.id}
|
||||
albumId={item.albumId}
|
||||
bookId={item.bookId}
|
||||
isSelected={selectedState[item.id]}
|
||||
columns={columns}
|
||||
{...item}
|
||||
@@ -264,7 +264,7 @@ class Queue extends Component {
|
||||
selectedIds.every((id) => {
|
||||
const item = items.find((i) => i.id === id);
|
||||
|
||||
return !!(item && item.artistId && item.albumId);
|
||||
return !!(item && item.authorId && item.bookId);
|
||||
})
|
||||
)}
|
||||
onRemovePress={this.onRemoveSelectedConfirmed}
|
||||
|
||||
@@ -62,10 +62,10 @@ class QueueConnector extends Component {
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
if (hasDifferentItems(prevProps.items, this.props.items)) {
|
||||
const albumIds = selectUniqueIds(this.props.items, 'albumId');
|
||||
const bookIds = selectUniqueIds(this.props.items, 'bookId');
|
||||
|
||||
if (albumIds.length) {
|
||||
this.props.fetchAlbums({ albumIds });
|
||||
if (bookIds.length) {
|
||||
this.props.fetchAlbums({ bookIds });
|
||||
} else {
|
||||
this.props.clearAlbums();
|
||||
}
|
||||
|
||||
@@ -137,13 +137,13 @@ class QueueRow extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'artist.sortName') {
|
||||
if (name === 'authors.sortName') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
{
|
||||
artist ?
|
||||
<ArtistNameLink
|
||||
foreignArtistId={artist.foreignArtistId}
|
||||
titleSlug={artist.titleSlug}
|
||||
artistName={artist.artistName}
|
||||
/> :
|
||||
title
|
||||
@@ -152,13 +152,13 @@ class QueueRow extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'album.title') {
|
||||
if (name === 'books.title') {
|
||||
return (
|
||||
<TableRowCell key={name}>
|
||||
{
|
||||
album ?
|
||||
<AlbumTitleLink
|
||||
foreignAlbumId={album.foreignAlbumId}
|
||||
titleSlug={album.titleSlug}
|
||||
title={album.title}
|
||||
disambiguation={album.disambiguation}
|
||||
/> :
|
||||
@@ -168,7 +168,7 @@ class QueueRow extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'album.releaseDate') {
|
||||
if (name === 'books.releaseDate') {
|
||||
if (album) {
|
||||
return (
|
||||
<RelativeDateCellConnector
|
||||
|
||||
Reference in New Issue
Block a user