mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-17 21:25:39 -04:00
New: Use Goodreads directly, allow multiple editions of a book (new DB required)
This commit is contained in:
@@ -23,6 +23,7 @@ import TableBody from 'Components/Table/TableBody';
|
||||
import SelectQualityModal from 'InteractiveImport/Quality/SelectQualityModal';
|
||||
import SelectAuthorModal from 'InteractiveImport/Author/SelectAuthorModal';
|
||||
import SelectBookModal from 'InteractiveImport/Book/SelectBookModal';
|
||||
import SelectEditionModal from 'InteractiveImport/Edition/SelectEditionModal';
|
||||
import ConfirmImportModal from 'InteractiveImport/Confirmation/ConfirmImportModal';
|
||||
import InteractiveImportRow from './InteractiveImportRow';
|
||||
import styles from './InteractiveImportModalContent.css';
|
||||
@@ -79,6 +80,7 @@ const importModeOptions = [
|
||||
const SELECT = 'select';
|
||||
const AUTHOR = 'author';
|
||||
const BOOK = 'book';
|
||||
const EDITION = 'edition';
|
||||
const QUALITY = 'quality';
|
||||
|
||||
const replaceExistingFilesOptions = {
|
||||
@@ -112,7 +114,7 @@ class InteractiveImportModalContent extends Component {
|
||||
const selectedItems = _.filter(this.props.items, (x) => _.includes(selectedIds, x.id));
|
||||
|
||||
const inconsistent = _(selectedItems)
|
||||
.map((x) => ({ bookId: x.book ? x.book.id : 0, releaseId: x.bookReleaseId }))
|
||||
.map((x) => ({ bookId: x.book ? x.book.id : 0, releaseId: x.EditionId }))
|
||||
.groupBy('bookId')
|
||||
.mapValues((book) => _(book).groupBy((x) => x.releaseId).values().value().length)
|
||||
.values()
|
||||
@@ -273,6 +275,7 @@ class InteractiveImportModalContent extends Component {
|
||||
const bulkSelectOptions = [
|
||||
{ key: SELECT, value: 'Select...', disabled: true },
|
||||
{ key: BOOK, value: 'Select Book' },
|
||||
{ key: EDITION, value: 'Select Edition' },
|
||||
{ key: QUALITY, value: 'Select Quality' }
|
||||
];
|
||||
|
||||
@@ -469,6 +472,13 @@ class InteractiveImportModalContent extends Component {
|
||||
onModalClose={this.onSelectModalClose}
|
||||
/>
|
||||
|
||||
<SelectEditionModal
|
||||
isOpen={selectModalOpen === EDITION}
|
||||
importIdsByBook={_.chain(items).filter((x) => x.album).groupBy((x) => x.book.id).mapValues((x) => x.map((y) => y.id)).value()}
|
||||
books={_.chain(items).filter((x) => x.book).keyBy((x) => x.book.id).mapValues((x) => ({ matchedEditionId: x.editionId, book: x.book })).values().value()}
|
||||
onModalClose={this.onSelectModalClose}
|
||||
/>
|
||||
|
||||
<SelectQualityModal
|
||||
isOpen={selectModalOpen === QUALITY}
|
||||
ids={selectedIds}
|
||||
|
||||
Reference in New Issue
Block a user