[PR #3670] [MERGED] Fix:Remove authors with no books when a books is removed #3668 #4048

Closed
opened 2026-04-25 00:18:07 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3670
Author: @advplyr
Created: 12/1/2024
Status: Merged
Merged: 12/1/2024
Merged by: @advplyr

Base: masterHead: fix_remove_authors_no_books


📝 Commits (3)

  • c496db7 Fix:Remove authors with no books when a books is removed #3668
  • 2b54842 Add LibraryItemController test for delete/batchDelete/updateMedia endpoint functions to correctly remove authors & series with no books
  • 0dedb09 Update:batchUpdate endpoint validate req.body is an array of objects

📊 Changes

6 files changed (+390 additions, -90 deletions)

View changed files

📝 server/controllers/LibraryController.js (+63 -3)
📝 server/controllers/LibraryItemController.js (+98 -34)
📝 server/managers/CacheManager.js (+1 -0)
📝 server/objects/LibraryItem.js (+1 -1)
📝 server/routers/ApiRouter.js (+25 -52)
test/server/controllers/LibraryItemController.test.js (+202 -0)

📄 Description

Brief summary

See https://github.com/advplyr/audiobookshelf/issues/3668 for the outlined issue

Which issue is fixed?

Fixes #3668

In-depth Description

Anytime a book is removed/updated we need to ensure that authors with no books (and metadata) and empty series get cleaned up.

This PR adds 2 functions that take in an array of seriesIds and authorIds. Those series & authors are checked for removal.

How have you tested this?

Working on unit test.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3670 **Author:** [@advplyr](https://github.com/advplyr) **Created:** 12/1/2024 **Status:** ✅ Merged **Merged:** 12/1/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `fix_remove_authors_no_books` --- ### 📝 Commits (3) - [`c496db7`](https://github.com/advplyr/audiobookshelf/commit/c496db7c95752407164aa55d4dc6f35e207db9f1) Fix:Remove authors with no books when a books is removed #3668 - [`2b54842`](https://github.com/advplyr/audiobookshelf/commit/2b5484243b649ed2dac3c996eb1d9b8e907b4c4a) Add LibraryItemController test for delete/batchDelete/updateMedia endpoint functions to correctly remove authors & series with no books - [`0dedb09`](https://github.com/advplyr/audiobookshelf/commit/0dedb09a07c3286d2383892520c107dfb06603c2) Update:batchUpdate endpoint validate req.body is an array of objects ### 📊 Changes **6 files changed** (+390 additions, -90 deletions) <details> <summary>View changed files</summary> 📝 `server/controllers/LibraryController.js` (+63 -3) 📝 `server/controllers/LibraryItemController.js` (+98 -34) 📝 `server/managers/CacheManager.js` (+1 -0) 📝 `server/objects/LibraryItem.js` (+1 -1) 📝 `server/routers/ApiRouter.js` (+25 -52) ➕ `test/server/controllers/LibraryItemController.test.js` (+202 -0) </details> ### 📄 Description ## Brief summary See https://github.com/advplyr/audiobookshelf/issues/3668 for the outlined issue ## Which issue is fixed? Fixes #3668 ## In-depth Description Anytime a book is removed/updated we need to ensure that authors with no books (and metadata) and empty series get cleaned up. This PR adds 2 functions that take in an array of seriesIds and authorIds. Those series & authors are checked for removal. ## How have you tested this? Working on unit test. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:07 +02:00
adam closed this issue 2026-04-25 00:18:07 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4048