[PR #3326] [CLOSED] Series cleanup #3935

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3326
Author: @nichwall
Created: 8/23/2024
Status: Closed

Base: masterHead: series_cleanup


📝 Commits (10+)

  • e7eda12 Add: deduplicate series on server startup
  • 896f2d4 Duplicate series need to have the same libraryId
  • 926896e Add: logging of how many series were removed
  • 4f6297e Update spacing
  • 9b87d55 Updates to use new Library model
  • a250915 Update series and collection width to account for book aspect ratio
  • 7a68dfc Fix embed and convert for single file library items
  • 9ffdf59 Updates to LibraryController to use new Library model
  • 9fedeba Updates to migrate off of old library model
  • 8bfca41 Fix:Check if book is already being merged before allowing to start #3331

📊 Changes

201 files changed (+10352 additions, -9598 deletions)

View changed files

.github/workflows/apply_comments.yaml (+55 -0)
📝 client/components/app/Appbar.vue (+2 -3)
📝 client/components/app/BookShelfToolbar.vue (+8 -12)
📝 client/components/app/MediaPlayerContainer.vue (+2 -11)
📝 client/components/app/SideRail.vue (+0 -14)
📝 client/components/cards/LazyBookCard.vue (+20 -44)
📝 client/components/cards/LazyCollectionCard.vue (+1 -13)
📝 client/components/cards/LazySeriesCard.vue (+2 -2)
📝 client/components/cards/NotificationCard.vue (+13 -15)
📝 client/components/content/LibraryItemDetails.vue (+2 -57)
📝 client/components/controls/GlobalSearch.vue (+1 -1)
📝 client/components/controls/LibraryFilterSelect.vue (+0 -29)
📝 client/components/controls/LibrarySortSelect.vue (+0 -33)
📝 client/components/modals/AccountModal.vue (+11 -11)
📝 client/components/modals/AddCustomMetadataProviderModal.vue (+5 -5)
📝 client/components/modals/AudioFileDataModal.vue (+2 -2)
📝 client/components/modals/BackupScheduleModal.vue (+1 -1)
📝 client/components/modals/BookmarksModal.vue (+1 -1)
📝 client/components/modals/ListeningSessionModal.vue (+2 -3)
📝 client/components/modals/ShareModal.vue (+1 -1)

...and 80 more files

📄 Description

This PR fixes https://github.com/advplyr/audiobookshelf/issues/3207 by combining series that have identical names and the same libraryId. I originally only used the series name, but realized that the same series may exist in two different libraries.

This PR does not fix the "duplicate entries" causing problems for the InputDropdown component, and instead fixes the data in the database itself.

This is done by adding a cleanup function to server startup which updates all bookSeries entries that have duplicate series names and libraryIds to point to the newest series, and then deletes the now-unused duplicates.

This will help handle issues with series from previous server versions, but I am not sure of the root cause of duplicate series (whether from a scanner, matching, or manual editing of an item). I briefly looked at all occurrences of SeriesModel and did not see anything that looked like it could cause duplicate series like this, so it may be a leftover bug from an older server version.


🔄 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/3326 **Author:** [@nichwall](https://github.com/nichwall) **Created:** 8/23/2024 **Status:** ❌ Closed **Base:** `master` ← **Head:** `series_cleanup` --- ### 📝 Commits (10+) - [`e7eda12`](https://github.com/advplyr/audiobookshelf/commit/e7eda126b6a53ae92aa5e881e82e87fbf8e01900) Add: deduplicate series on server startup - [`896f2d4`](https://github.com/advplyr/audiobookshelf/commit/896f2d472059b39482062e137316be03719b6693) Duplicate series need to have the same libraryId - [`926896e`](https://github.com/advplyr/audiobookshelf/commit/926896eca630e8a5184a1615b7a3a019322395d1) Add: logging of how many series were removed - [`4f6297e`](https://github.com/advplyr/audiobookshelf/commit/4f6297e896c86bf46e9309a260b135c0992aec82) Update spacing - [`9b87d55`](https://github.com/advplyr/audiobookshelf/commit/9b87d5500ebfa8d78cb42b75e00ddacc96037cb1) Updates to use new Library model - [`a250915`](https://github.com/advplyr/audiobookshelf/commit/a250915fde1be4356ff0de1a6b98ff705013084d) Update series and collection width to account for book aspect ratio - [`7a68dfc`](https://github.com/advplyr/audiobookshelf/commit/7a68dfc6c72bbda62b39e5039396d21f17022ec5) Fix embed and convert for single file library items - [`9ffdf59`](https://github.com/advplyr/audiobookshelf/commit/9ffdf5910fdff26f4bb3b42cd0c167af3cf03857) Updates to LibraryController to use new Library model - [`9fedeba`](https://github.com/advplyr/audiobookshelf/commit/9fedebaae1f60798e197a8066a244af44033b3be) Updates to migrate off of old library model - [`8bfca41`](https://github.com/advplyr/audiobookshelf/commit/8bfca412c33caca7478614f72a03ddd63e749f02) Fix:Check if book is already being merged before allowing to start #3331 ### 📊 Changes **201 files changed** (+10352 additions, -9598 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/apply_comments.yaml` (+55 -0) 📝 `client/components/app/Appbar.vue` (+2 -3) 📝 `client/components/app/BookShelfToolbar.vue` (+8 -12) 📝 `client/components/app/MediaPlayerContainer.vue` (+2 -11) 📝 `client/components/app/SideRail.vue` (+0 -14) 📝 `client/components/cards/LazyBookCard.vue` (+20 -44) 📝 `client/components/cards/LazyCollectionCard.vue` (+1 -13) 📝 `client/components/cards/LazySeriesCard.vue` (+2 -2) 📝 `client/components/cards/NotificationCard.vue` (+13 -15) 📝 `client/components/content/LibraryItemDetails.vue` (+2 -57) 📝 `client/components/controls/GlobalSearch.vue` (+1 -1) 📝 `client/components/controls/LibraryFilterSelect.vue` (+0 -29) 📝 `client/components/controls/LibrarySortSelect.vue` (+0 -33) 📝 `client/components/modals/AccountModal.vue` (+11 -11) 📝 `client/components/modals/AddCustomMetadataProviderModal.vue` (+5 -5) 📝 `client/components/modals/AudioFileDataModal.vue` (+2 -2) 📝 `client/components/modals/BackupScheduleModal.vue` (+1 -1) 📝 `client/components/modals/BookmarksModal.vue` (+1 -1) 📝 `client/components/modals/ListeningSessionModal.vue` (+2 -3) 📝 `client/components/modals/ShareModal.vue` (+1 -1) _...and 80 more files_ </details> ### 📄 Description This PR fixes https://github.com/advplyr/audiobookshelf/issues/3207 by combining series that have identical names and the same `libraryId`. I originally only used the series name, but realized that the same series may exist in two different libraries. This PR does not fix the "duplicate entries" causing problems for the InputDropdown component, and instead fixes the data in the database itself. This is done by adding a cleanup function to server startup which updates all `bookSeries` entries that have duplicate series names and libraryIds to point to the newest series, and then deletes the now-unused duplicates. This will help handle issues with series from previous server versions, but I am not sure of the root cause of duplicate series (whether from a scanner, matching, or manual editing of an item). I briefly looked at all occurrences of ` SeriesModel` and did not see anything that looked like it could cause duplicate series like this, so it may be a leftover bug from an older server version. --- <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:17:38 +02:00
adam closed this issue 2026-04-25 00:17:38 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3935