From c817d6c0d848a1eef24a96962bbabf8d57398306 Mon Sep 17 00:00:00 2001 From: ta264 Date: Fri, 10 Dec 2021 19:28:14 +0000 Subject: [PATCH] Fixed: Error 'Book with Id not found' in manual import --- .../InteractiveImport/Interactive/InteractiveImportRow.js | 6 ++++++ src/Readarr.Api.V1/ManualImport/ManualImportResource.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.js b/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.js index 41635978f..17b8cc512 100644 --- a/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.js +++ b/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.js @@ -41,12 +41,14 @@ class InteractiveImportRow extends Component { id, author, book, + foreignEditionId, quality } = this.props; if ( author && book != null && + foreignEditionId && quality ) { this.props.onSelectedChange({ id, value: true }); @@ -58,6 +60,7 @@ class InteractiveImportRow extends Component { id, author, book, + foreignEditionId, quality, isSelected, onValidRowChange @@ -66,6 +69,7 @@ class InteractiveImportRow extends Component { if ( prevProps.author === author && prevProps.book === book && + prevProps.foreignEditionId === foreignEditionId && prevProps.quality === quality && prevProps.isSelected === isSelected ) { @@ -75,6 +79,7 @@ class InteractiveImportRow extends Component { const isValid = !!( author && book && + foreignEditionId && quality ); @@ -337,6 +342,7 @@ InteractiveImportRow.propTypes = { path: PropTypes.string.isRequired, author: PropTypes.object, book: PropTypes.object, + foreignEditionId: PropTypes.string, quality: PropTypes.object, size: PropTypes.number.isRequired, rejections: PropTypes.arrayOf(PropTypes.object).isRequired, diff --git a/src/Readarr.Api.V1/ManualImport/ManualImportResource.cs b/src/Readarr.Api.V1/ManualImport/ManualImportResource.cs index baa945623..bc6c14b1b 100644 --- a/src/Readarr.Api.V1/ManualImport/ManualImportResource.cs +++ b/src/Readarr.Api.V1/ManualImport/ManualImportResource.cs @@ -45,7 +45,7 @@ namespace Readarr.Api.V1.ManualImport Size = model.Size, Author = model.Author.ToResource(), Book = model.Book.ToResource(), - ForeignEditionId = model.Edition?.ForeignEditionId, + ForeignEditionId = model.Edition?.ForeignEditionId ?? model.Book.Editions.Value.Single(x => x.Monitored).ForeignEditionId, Quality = model.Quality, //QualityWeight