From aed4c2ce8a0160858c7ae3cd88dbb787a40046ea Mon Sep 17 00:00:00 2001 From: jordan Date: Tue, 29 Sep 2026 20:05:45 +0000 Subject: [PATCH 1/2] fix(ui): delete-author dialog lists every author folder, not only the legacy path The delete dialog rendered a single `path` (the legacy Author.Path) in both the folder line and the "author folder and all of its content will be deleted" warning. An author can have separate audiobook and ebook folders (audiobookPath / ebookPath), and deleting with "delete files" removes all of them, so the dialog named the wrong - or only one - folder. Example: an ebook-only author whose page header showed /mnt/Media/Books/ got a dialog that named /mnt/Media/Audio Books/. The connector already spreads the whole author resource into the component, so audiobookPath and ebookPath are available. List each distinct non-empty path among path/audiobookPath/ ebookPath, and repeat the existing warning once per folder (no new translation strings). The file count/size already comes from the author statistics and covers both formats. --- .../Author/Delete/DeleteAuthorModalContent.js | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/frontend/src/Author/Delete/DeleteAuthorModalContent.js b/frontend/src/Author/Delete/DeleteAuthorModalContent.js index f6a94658..e08a2754 100644 --- a/frontend/src/Author/Delete/DeleteAuthorModalContent.js +++ b/frontend/src/Author/Delete/DeleteAuthorModalContent.js @@ -63,10 +63,18 @@ class DeleteAuthorModalContent extends Component { const { authorName, path, + audiobookPath, + ebookPath, statistics, onModalClose } = this.props; + // An author can have a separate audiobook and ebook folder (plus the legacy single path). Deleting + // with "delete files" removes all of them, so list every distinct one instead of only `path`. + const paths = [path, audiobookPath, ebookPath] + .filter((folder) => !!folder && folder.trim() !== '') + .filter((folder, index, all) => all.indexOf(folder) === index); + const { bookFileCount, sizeOnDisk @@ -93,14 +101,21 @@ class DeleteAuthorModalContent extends Component { -
- - - {path} -
+ { + paths.map((folder) => ( +
+ + + {folder} +
+ )) + } {deleteFilesLabel} @@ -149,9 +164,13 @@ class DeleteAuthorModalContent extends Component { { deleteFiles &&
-
- {translate('TheAuthorFolderAndAllOfItsContentWillBeDeleted', [path])} -
+ { + paths.map((folder) => ( +
+ {translate('TheAuthorFolderAndAllOfItsContentWillBeDeleted', [folder])} +
+ )) + } { !!bookFileCount && @@ -182,6 +201,8 @@ class DeleteAuthorModalContent extends Component { DeleteAuthorModalContent.propTypes = { authorName: PropTypes.string.isRequired, path: PropTypes.string.isRequired, + audiobookPath: PropTypes.string, + ebookPath: PropTypes.string, statistics: PropTypes.object.isRequired, onDeletePress: PropTypes.func.isRequired, onModalClose: PropTypes.func.isRequired From 036b19ad5684158212c9aa8e03f795931206730f Mon Sep 17 00:00:00 2001 From: jordan Date: Tue, 29 Sep 2026 20:40:22 +0000 Subject: [PATCH 2/2] fix(ui): read the author's real folder fields (audiobookFolder / ebookFolder) in the delete dialog The previous commit listed audiobookPath / ebookPath from the author resource, but AuthorResource does not expose those: it maps Author.AudiobookPath / EbookPath to audiobookFolder / ebookFolder, and audiobookPath / ebookPath are null on the API response. So the dialog still only ever showed `path`. Checked against live data: for 2564 of 2774 authors the API has two distinct folders (audiobookFolder + ebookFolder), and for one author three. Use audiobookFolder and ebookFolder. Same de-duplication and one warning line per folder. --- .../src/Author/Delete/DeleteAuthorModalContent.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/Author/Delete/DeleteAuthorModalContent.js b/frontend/src/Author/Delete/DeleteAuthorModalContent.js index e08a2754..41a104f9 100644 --- a/frontend/src/Author/Delete/DeleteAuthorModalContent.js +++ b/frontend/src/Author/Delete/DeleteAuthorModalContent.js @@ -63,15 +63,17 @@ class DeleteAuthorModalContent extends Component { const { authorName, path, - audiobookPath, - ebookPath, + audiobookFolder, + ebookFolder, statistics, onModalClose } = this.props; // An author can have a separate audiobook and ebook folder (plus the legacy single path). Deleting // with "delete files" removes all of them, so list every distinct one instead of only `path`. - const paths = [path, audiobookPath, ebookPath] + // The API exposes the format folders as audiobookFolder / ebookFolder (AuthorResource) - not + // audiobookPath / ebookPath, which are null on the resource. + const paths = [path, audiobookFolder, ebookFolder] .filter((folder) => !!folder && folder.trim() !== '') .filter((folder, index, all) => all.indexOf(folder) === index); @@ -201,8 +203,8 @@ class DeleteAuthorModalContent extends Component { DeleteAuthorModalContent.propTypes = { authorName: PropTypes.string.isRequired, path: PropTypes.string.isRequired, - audiobookPath: PropTypes.string, - ebookPath: PropTypes.string, + audiobookFolder: PropTypes.string, + ebookFolder: PropTypes.string, statistics: PropTypes.object.isRequired, onDeletePress: PropTypes.func.isRequired, onModalClose: PropTypes.func.isRequired