Skip to content

fix(ui): delete-author dialog lists every author folder, not only the legacy path - #269

Open
jordanfelle wants to merge 2 commits into
Chaptarr:developfrom
jordanfelle:fix-delete-author-modal-format-paths
Open

jordanfelle wants to merge 2 commits into
Chaptarr:developfrom
jordanfelle:fix-delete-author-modal-format-paths

Conversation

@jordanfelle

@jordanfelle jordanfelle commented Sep 29, 2026 •

Copy link
Copy Markdown

Problem

The delete-author dialog rendered a single path (the legacy Author.Path) in both the folder line and the "The author folder ... and all of its content will be deleted" warning. An author can have separate audiobook and ebook folders, and deleting with "delete files" removes all of them, so the dialog named only one folder.

Seen live: an ebook-only author whose page header showed /mnt/Media/Books/<name> got a delete dialog naming /mnt/Media/Audio Books/<name>; and after the first version of this PR, an author with both folders still showed one.

Change

DeleteAuthorModalContentConnector spreads the whole author resource into the component. The resource exposes the format folders as audiobookFolder / ebookFolder (AuthorResource maps Author.AudiobookPath / EbookPath to them); audiobookPath / ebookPath are null on the API response. The dialog now lists each distinct, non-empty folder among path / audiobookFolder / ebookFolder, and repeats the existing warning once per folder (no new translation strings). The file count and size already come from the author statistics and cover both formats.

Checked against live API data: 2564 of 2774 authors have two distinct folders and one has three, so this changes the dialog for nearly every author.

Correction to the first version of this PR

The first commit read audiobookPath / ebookPath, which the API does not populate, so it never showed more than path. Adversarial review checked the code but not real data and missed it; caught by looking at the dialog on a live author.

Testing

Syntax-checked with esbuild; the full webpack production build compiles. No frontend tests exist in this repo. Verified the field names and folder counts against the live /api/v1/author response; not yet re-verified in a browser after this fix.

Known limitation

A folder is listed whenever it is configured on the author, whether or not it exists on disk (e.g. an ebook folder that was never created), so the warning can name a folder with nothing in it.

… 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/<name> got a dialog that named
/mnt/Media/Audio Books/<name>.

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.
…kFolder) 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant