[PR #5046] Add 5-star rating and review system #4404

Open
opened 2026-04-25 00:19:37 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/5046
Author: @fannta1990
Created: 2/9/2026
Status: 🔄 Open

Base: masterHead: star-review-and-comments-server-internally


📝 Commits (5)

  • 3a8075a Created Rating and Review Feature as well as added a Top Rated books list to the Stats page
  • e4e2770 Fixed error for Ratings page and stats page & added controlls to make Rating system and Ratings page optional (admin can turn it on or off for the server)
  • 41e8906 Add review and rating features with sorting and filtering options
  • d2285d9 Enhance review and ratings functionality with new filters and UI improvements
  • 633bc48 Add review deletion functionality and UI enhancements

📊 Changes

21 files changed (+1671 additions, -2 deletions)

View changed files

📝 .vscode/settings.json (+3 -0)
📝 client/components/app/SideRail.vue (+17 -0)
client/components/modals/ReviewModal.vue (+128 -0)
client/components/tables/ReviewsTable.vue (+147 -0)
client/components/ui/StarRating.vue (+64 -0)
📝 client/pages/config/index.vue (+20 -0)
📝 client/pages/item/_id/index.vue (+9 -0)
client/pages/library/_library/ratings.vue (+297 -0)
📝 client/pages/library/_library/stats.vue (+26 -0)
📝 client/store/globals.js (+14 -2)
📝 client/strings/en-us.json (+24 -0)
📝 server/Database.js (+6 -0)
📝 server/Server.js (+1 -0)
📝 server/controllers/LibraryController.js (+41 -0)
server/controllers/ReviewController.js (+388 -0)
server/migrations/v2.33.0-create-reviews-table.js (+110 -0)
server/models/Review.js (+107 -0)
📝 server/objects/settings/ServerSettings.js (+10 -0)
📝 server/routers/ApiRouter.js (+8 -0)
test/server/controllers/ReviewController.test.js (+154 -0)

...and 1 more files

📄 Description

Brief summary

Introduces a native 5-star rating and review system for library items. Users can now rate books and podcasts and leave personal text reviews visible for all users on the server. The rating and review system can be turned off in the admin server settings. Optionally the ratings and reviews can be enabled, and the Ratings Page on the Sidebar can be hidden/disabled in the admin server settings.

Which issue is fixed?

Fixes #1890, #4487 by adding a new 5 star rating system with optional review text that can be displayed to all users on the server.

In-depth Description

This PR implements a full-featured internal review system:

  • Server-side Improvements:
    • Data Model: Added a new Review model and a corresponding reviews table. It enforces a unique constraint so each user can have one review per library item.
    • Controller: Implemented ReviewController with full CRUD support and advanced querying (filtering by rating/user, sorting by highest/lowest/newest).
    • Settings: Added a global enableReviews toggle in server settings to control the feature visibility.
    • API: New endpoints under /api/items/:id/review and /api/libraries/:id/reviews.
  • Client-side Enhancements:
    • UI Components: New StarRating and ReviewModal components for a modern interaction flow.
    • Library Ratings Page: A new "Ratings" view in the library sidebar to browse, filter, and sort all reviews within that library.
    • Item Integration: Reviews are now visible and editable directly from the library item details page.
    • Stats Update: The "Stats" page now includes a "Top 10 Best Rated" section.
  • Robustness: Includes comprehensive unit and integration tests for the new backend logic.

How have you tested this?

  • Manual UI Testing: Verified creating, editing, and deleting reviews from the item details page.
  • Library Management: Tested the new Ratings page filters and sorting options with multiple users.
  • Settings Toggle: Verified that disabling the feature in settings correctly hides the UI elements and returns 403 for API requests.
  • Automated Tests: Ran the new suite of unit and integration tests.

Screenshots

Screenshot 2026-02-09 at 22 37 26 Screenshot 2026-02-09 at 22 34 41 Screenshot 2026-02-09 at 22 34 16 Screenshot 2026-02-09 at 22 15 34 Screenshot 2026-02-09 at 22 14 39 Screenshot 2026-02-09 at 22 13 10 Screenshot 2026-02-09 at 22 12 22

🔄 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/5046 **Author:** [@fannta1990](https://github.com/fannta1990) **Created:** 2/9/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `star-review-and-comments-server-internally` --- ### 📝 Commits (5) - [`3a8075a`](https://github.com/advplyr/audiobookshelf/commit/3a8075a0779b9cd6f77bccb9dd0e47243272b000) Created Rating and Review Feature as well as added a Top Rated books list to the Stats page - [`e4e2770`](https://github.com/advplyr/audiobookshelf/commit/e4e2770fbd514dca5c6b7c309a443b81d8e16181) Fixed error for Ratings page and stats page & added controlls to make Rating system and Ratings page optional (admin can turn it on or off for the server) - [`41e8906`](https://github.com/advplyr/audiobookshelf/commit/41e89063121990f6e91ba2a4453c7f6f341c549c) Add review and rating features with sorting and filtering options - [`d2285d9`](https://github.com/advplyr/audiobookshelf/commit/d2285d952a061b324fcd59f8bb3165a28404824c) Enhance review and ratings functionality with new filters and UI improvements - [`633bc48`](https://github.com/advplyr/audiobookshelf/commit/633bc4805e53650d795fbf7e59676b4ec2d62213) Add review deletion functionality and UI enhancements ### 📊 Changes **21 files changed** (+1671 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `.vscode/settings.json` (+3 -0) 📝 `client/components/app/SideRail.vue` (+17 -0) ➕ `client/components/modals/ReviewModal.vue` (+128 -0) ➕ `client/components/tables/ReviewsTable.vue` (+147 -0) ➕ `client/components/ui/StarRating.vue` (+64 -0) 📝 `client/pages/config/index.vue` (+20 -0) 📝 `client/pages/item/_id/index.vue` (+9 -0) ➕ `client/pages/library/_library/ratings.vue` (+297 -0) 📝 `client/pages/library/_library/stats.vue` (+26 -0) 📝 `client/store/globals.js` (+14 -2) 📝 `client/strings/en-us.json` (+24 -0) 📝 `server/Database.js` (+6 -0) 📝 `server/Server.js` (+1 -0) 📝 `server/controllers/LibraryController.js` (+41 -0) ➕ `server/controllers/ReviewController.js` (+388 -0) ➕ `server/migrations/v2.33.0-create-reviews-table.js` (+110 -0) ➕ `server/models/Review.js` (+107 -0) 📝 `server/objects/settings/ServerSettings.js` (+10 -0) 📝 `server/routers/ApiRouter.js` (+8 -0) ➕ `test/server/controllers/ReviewController.test.js` (+154 -0) _...and 1 more files_ </details> ### 📄 Description ## Brief summary Introduces a native 5-star rating and review system for library items. Users can now rate books and podcasts and leave personal text reviews visible for all users on the server. The rating and review system can be turned off in the admin server settings. Optionally the ratings and reviews can be enabled, and the Ratings Page on the Sidebar can be hidden/disabled in the admin server settings. ## Which issue is fixed? Fixes #1890, #4487 by adding a new 5 star rating system with optional review text that can be displayed to all users on the server. ## In-depth Description This PR implements a full-featured internal review system: - **Server-side Improvements:** - **Data Model:** Added a new `Review` model and a corresponding `reviews` table. It enforces a unique constraint so each user can have one review per library item. - **Controller:** Implemented `ReviewController` with full CRUD support and advanced querying (filtering by rating/user, sorting by highest/lowest/newest). - **Settings:** Added a global `enableReviews` toggle in server settings to control the feature visibility. - **API:** New endpoints under `/api/items/:id/review` and `/api/libraries/:id/reviews`. - **Client-side Enhancements:** - **UI Components:** New `StarRating` and `ReviewModal` components for a modern interaction flow. - **Library Ratings Page:** A new "Ratings" view in the library sidebar to browse, filter, and sort all reviews within that library. - **Item Integration:** Reviews are now visible and editable directly from the library item details page. - **Stats Update:** The "Stats" page now includes a "Top 10 Best Rated" section. - **Robustness:** Includes comprehensive unit and integration tests for the new backend logic. ## How have you tested this? - **Manual UI Testing:** Verified creating, editing, and deleting reviews from the item details page. - **Library Management:** Tested the new Ratings page filters and sorting options with multiple users. - **Settings Toggle:** Verified that disabling the feature in settings correctly hides the UI elements and returns 403 for API requests. - **Automated Tests:** Ran the new suite of unit and integration tests. ## Screenshots <img width="919" height="622" alt="Screenshot 2026-02-09 at 22 37 26" src="https://github.com/user-attachments/assets/d5050483-9c9d-4198-a9c6-6c9207fab40b" /> <img width="909" height="684" alt="Screenshot 2026-02-09 at 22 34 41" src="https://github.com/user-attachments/assets/bad1c8d4-d4d2-4da1-b9fc-0013dd75bf20" /> <img width="904" height="684" alt="Screenshot 2026-02-09 at 22 34 16" src="https://github.com/user-attachments/assets/08b4dd33-47f4-4817-95b4-0d66a81415a6" /> <img width="1133" height="607" alt="Screenshot 2026-02-09 at 22 15 34" src="https://github.com/user-attachments/assets/13617fc7-da2c-4146-b81d-df4cf71018fa" /> <img width="1139" height="615" alt="Screenshot 2026-02-09 at 22 14 39" src="https://github.com/user-attachments/assets/2a83975c-f962-49bc-9891-64a61372132f" /> <img width="1127" height="609" alt="Screenshot 2026-02-09 at 22 13 10" src="https://github.com/user-attachments/assets/fe34b2ac-c355-4282-b988-faf17ea9692f" /> <img width="1102" height="605" alt="Screenshot 2026-02-09 at 22 12 22" src="https://github.com/user-attachments/assets/3d9a068d-5e2e-42a6-8d56-e4e2e5cd4bd8" /> --- <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:19:37 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4404