[PR #3487] [MERGED] Move authors to LazyBookshelf #3987

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3487
Author: @mikiher
Created: 10/6/2024
Status: Merged
Merged: 10/6/2024
Merged by: @advplyr

Base: masterHead: lazy-bookshelf-authors


📝 Commits (4)

  • 0bdc2fb Move authors to lazyBookshelf
  • 6820d9a Fix AuthorCard component test
  • 8ba17db Fix authors button in SideRail selected
  • 64b78b5 Move pagination limit/page query param validation to middleware & check for positive integer

📊 Changes

13 files changed (+238 additions, -204 deletions)

View changed files

📝 client/components/app/BookShelfRow.vue (+1 -1)
📝 client/components/app/BookShelfToolbar.vue (+46 -35)
📝 client/components/app/LazyBookshelf.vue (+46 -0)
📝 client/components/app/SideRail.vue (+2 -2)
📝 client/components/cards/AuthorCard.vue (+47 -16)
📝 client/components/widgets/ItemSlider.vue (+1 -1)
📝 client/cypress/tests/components/cards/AuthorCard.cy.js (+2 -2)
📝 client/mixins/bookshelfCardsHelpers.js (+9 -4)
📝 client/pages/author/_id.vue (+2 -2)
client/pages/library/_library/authors/index.vue (+0 -115)
📝 client/pages/library/_library/bookshelf/_id.vue (+1 -1)
📝 client/strings/en-us.json (+1 -0)
📝 server/controllers/LibraryController.js (+80 -25)

📄 Description

This moves the authors page to use LazyBookshelf. The main gain here is reduction in page load time. I have about 2750 authors in my library, and loading the page used to take 4-5 seconds on a pretty powerful PC. Now it takes less than half a second (it is somewhat hard to measure exactly due to all the hidden updates to the DOM).

The following client changes were made:

  • Modifed AuthorCard to be "lazy" (i.e. loaded late by bookshelfCardsHelpers)
    • Stopped requiring to provide an author upfront
    • Stopped relying on author availability in computed methods
    • Added setEntity, destroy, and setSelectionMode (required by bookshelfCardsHelpers and LazyBookshelf)
  • Changed bookshelfCardHelpers.js to be able to load AuthorCard components.
  • Modified BookShelfToolbar
    • Removed the authors prop (since it is not available to caller anymore)
    • Added number of authors on the left (to be consistent with other bookshelf views)
    • Changed matchAllAuthors to fetch all authors from server (since authors are not passed as a prop anymore)
  • Modified LazyBookshelf to handle author editing, sorting, and loading
    • Calls to fetch authors are now paginated like other entity types
  • Changed all /library/_library/authors references to /library/_library/bookshelf/authors
  • Removed /library/_library/authors/index.vue

The following server changes were made:

  • Added support for pagination and server-side sorting in getAuthors (in LibraryController.js)

🔄 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/3487 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 10/6/2024 **Status:** ✅ Merged **Merged:** 10/6/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `lazy-bookshelf-authors` --- ### 📝 Commits (4) - [`0bdc2fb`](https://github.com/advplyr/audiobookshelf/commit/0bdc2fb05ea7e2033a787714b86171d3d1537b29) Move authors to lazyBookshelf - [`6820d9a`](https://github.com/advplyr/audiobookshelf/commit/6820d9ae4e80cbfa5ac1142a5243960f0b5975c6) Fix AuthorCard component test - [`8ba17db`](https://github.com/advplyr/audiobookshelf/commit/8ba17db877c53d1feba2c1a1c31a38805760d4c3) Fix authors button in SideRail selected - [`64b78b5`](https://github.com/advplyr/audiobookshelf/commit/64b78b5822f5c5410975dfab524c6f3ab09ad5ba) Move pagination limit/page query param validation to middleware & check for positive integer ### 📊 Changes **13 files changed** (+238 additions, -204 deletions) <details> <summary>View changed files</summary> 📝 `client/components/app/BookShelfRow.vue` (+1 -1) 📝 `client/components/app/BookShelfToolbar.vue` (+46 -35) 📝 `client/components/app/LazyBookshelf.vue` (+46 -0) 📝 `client/components/app/SideRail.vue` (+2 -2) 📝 `client/components/cards/AuthorCard.vue` (+47 -16) 📝 `client/components/widgets/ItemSlider.vue` (+1 -1) 📝 `client/cypress/tests/components/cards/AuthorCard.cy.js` (+2 -2) 📝 `client/mixins/bookshelfCardsHelpers.js` (+9 -4) 📝 `client/pages/author/_id.vue` (+2 -2) ➖ `client/pages/library/_library/authors/index.vue` (+0 -115) 📝 `client/pages/library/_library/bookshelf/_id.vue` (+1 -1) 📝 `client/strings/en-us.json` (+1 -0) 📝 `server/controllers/LibraryController.js` (+80 -25) </details> ### 📄 Description This moves the authors page to use LazyBookshelf. The main gain here is reduction in page load time. I have about 2750 authors in my library, and loading the page used to take 4-5 seconds on a pretty powerful PC. Now it takes less than half a second (it is somewhat hard to measure exactly due to all the hidden updates to the DOM). The following client changes were made: - Modifed `AuthorCard ` to be "lazy" (i.e. loaded late by `bookshelfCardsHelpers`) - Stopped requiring to provide an author upfront - Stopped relying on `author` availability in computed methods - Added `setEntity`, `destroy`, and `setSelectionMode` (required by `bookshelfCardsHelpers` and `LazyBookshelf`) - Changed `bookshelfCardHelpers.js` to be able to load `AuthorCard` components. - Modified `BookShelfToolbar` - Removed the authors prop (since it is not available to caller anymore) - Added number of authors on the left (to be consistent with other bookshelf views) - Changed `matchAllAuthors` to fetch all authors from server (since authors are not passed as a prop anymore) - Modified `LazyBookshelf` to handle author editing, sorting, and loading - Calls to fetch authors are now paginated like other entity types - Changed all `/library/_library/authors` references to `/library/_library/bookshelf/authors` - Removed `/library/_library/authors/index.vue` The following server changes were made: - Added support for pagination and server-side sorting in `getAuthors` (in `LibraryController.js`) --- <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:50 +02:00
adam closed this issue 2026-04-25 00:17:51 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3987