[PR #4574] [CLOSED] Issue 4540 New SortBy Options: Started Date & Finished Date #4290

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4574
Author: @tagmeh
Created: 8/11/2025
Status: Closed

Base: masterHead: Issue-4540-Sortby-Started-On-Finished-On


📝 Commits (10+)

  • 42eb4e3 Feature mostly implemented, has UI/CSS bug, not super DRY, no tests.
  • 6edfcfb Merge branch 'master' of https://github.com/tagmeh/audiobookshelf
  • 3cdf16e Merge branch 'advplyr:master' into master
  • 093be36 Merge branch 'advplyr:master' into master
  • 28d98b4 Merge branch 'advplyr:master' into master
  • a2c7d64 Working 1.0. Removed duplicate api calls per image. Attempted testing, removed, unable to figure out either testing option.
  • fc655bc Removed Cover.cy.js file. Wasn't able to figure out cypress testing.
  • faa0a83 Removed console logs.
  • 43ca263 Fixed rectangle book cover sub-sorting and conditional divider display.
  • 34c4e7b Added cy-ids to divs for testing purposes. Added a basic test for Cover.vue, and actual logic tests for SortedCovers.vue. All tests are passing.

📊 Changes

9 files changed (+648 additions, -33 deletions)

View changed files

📝 client/components/cards/LazyBookCard.vue (+17 -0)
📝 client/components/controls/LibrarySortSelect.vue (+9 -1)
client/components/covers/DisplayCover.vue (+113 -0)
client/components/covers/SortedCovers.vue (+102 -0)
📝 client/components/modals/item/tabs/Cover.vue (+72 -28)
client/cypress/tests/components/covers/SortedCovers.cy.js (+184 -0)
client/cypress/tests/components/modals/item/tab/Cover.cy.js (+131 -0)
📝 client/strings/en-us.json (+5 -1)
📝 server/utils/queries/libraryItemsBookFilters.js (+15 -3)

📄 Description

Brief summary

Adds two sort options: "Started Date" and "Finished Date"

Which issue is fixed?

Fixes #4540

In-depth Description

This PR adds the two sort options "Started Date" and "Finished Date" to the sort dropdown. The changes are similar to https://github.com/advplyr/audiobookshelf/pull/4542.

Books are sorted by if they have a startedDate (createdAt) or finishDate (finishAt) value first, then everything else, then ascending or descending. This keeps books with values at the top of the page and avoids requiring the user to scroll to the bottom, passed books they haven't started/finished in order to see the reversed sort. An attempt was made to show the date + time, but I guess the time isn't kept for these fields.

How have you tested this?

Manually tested, see screenshots.

Screenshots

Sort Options:
Started Date Asc
image

Started Date Desc
image

Finished Date Asc
image

Finished Date Desc
image

Filters + Sort Options:
Progress.In-Progress + Started Date
image

Progress.In-Progress + Finished Date
image

Progress.Finished + Started Date
image

Progress.Finished + Finished Date
image


🔄 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/4574 **Author:** [@tagmeh](https://github.com/tagmeh) **Created:** 8/11/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `Issue-4540-Sortby-Started-On-Finished-On` --- ### 📝 Commits (10+) - [`42eb4e3`](https://github.com/advplyr/audiobookshelf/commit/42eb4e3f0411b16146dc27b65fb55b9c0afbd069) Feature mostly implemented, has UI/CSS bug, not super DRY, no tests. - [`6edfcfb`](https://github.com/advplyr/audiobookshelf/commit/6edfcfb271573dad415e47c60a6a7dc0d6d14893) Merge branch 'master' of https://github.com/tagmeh/audiobookshelf - [`3cdf16e`](https://github.com/advplyr/audiobookshelf/commit/3cdf16e86fdd0da17c4077917d74821177da7f4b) Merge branch 'advplyr:master' into master - [`093be36`](https://github.com/advplyr/audiobookshelf/commit/093be36192acaf437dec980729103f732a7dd120) Merge branch 'advplyr:master' into master - [`28d98b4`](https://github.com/advplyr/audiobookshelf/commit/28d98b4dbce8709c955529ce70caf10f39c34506) Merge branch 'advplyr:master' into master - [`a2c7d64`](https://github.com/advplyr/audiobookshelf/commit/a2c7d645445683cda3e8d683d69dcde4fde74f2a) Working 1.0. Removed duplicate api calls per image. Attempted testing, removed, unable to figure out either testing option. - [`fc655bc`](https://github.com/advplyr/audiobookshelf/commit/fc655bc0e29cacabbf6f264d4b50a82969a3e170) Removed Cover.cy.js file. Wasn't able to figure out cypress testing. - [`faa0a83`](https://github.com/advplyr/audiobookshelf/commit/faa0a833e2c254efc84780ac7933a07102569f9a) Removed console logs. - [`43ca263`](https://github.com/advplyr/audiobookshelf/commit/43ca263eac95d63a57e7fb5ba83f6c7f52945cce) Fixed rectangle book cover sub-sorting and conditional divider display. - [`34c4e7b`](https://github.com/advplyr/audiobookshelf/commit/34c4e7b08457bfa53ca4d0e7bfe4429007a1ce7d) Added cy-ids to divs for testing purposes. Added a basic test for Cover.vue, and actual logic tests for SortedCovers.vue. All tests are passing. ### 📊 Changes **9 files changed** (+648 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `client/components/cards/LazyBookCard.vue` (+17 -0) 📝 `client/components/controls/LibrarySortSelect.vue` (+9 -1) ➕ `client/components/covers/DisplayCover.vue` (+113 -0) ➕ `client/components/covers/SortedCovers.vue` (+102 -0) 📝 `client/components/modals/item/tabs/Cover.vue` (+72 -28) ➕ `client/cypress/tests/components/covers/SortedCovers.cy.js` (+184 -0) ➕ `client/cypress/tests/components/modals/item/tab/Cover.cy.js` (+131 -0) 📝 `client/strings/en-us.json` (+5 -1) 📝 `server/utils/queries/libraryItemsBookFilters.js` (+15 -3) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary Adds two sort options: "Started Date" and "Finished Date" ## Which issue is fixed? Fixes #4540 ## In-depth Description This PR adds the two sort options "Started Date" and "Finished Date" to the sort dropdown. The changes are similar to https://github.com/advplyr/audiobookshelf/pull/4542. Books are sorted by if they have a startedDate (createdAt) or finishDate (finishAt) value first, then everything else, then ascending or descending. This keeps books with values at the top of the page and avoids requiring the user to scroll to the bottom, passed books they haven't started/finished in order to see the reversed sort. An attempt was made to show the date + time, but I guess the time isn't kept for these fields. ## How have you tested this? Manually tested, see screenshots. ## Screenshots Sort Options: Started Date Asc <img width="550" height="381" alt="image" src="https://github.com/user-attachments/assets/e0184da4-7c4c-4327-a951-bf77ff976733" /> Started Date Desc <img width="547" height="382" alt="image" src="https://github.com/user-attachments/assets/e670d8e5-f58c-47c8-995e-17677341077b" /> Finished Date Asc <img width="554" height="378" alt="image" src="https://github.com/user-attachments/assets/94125e28-757d-4e97-9d50-e3ff292d0754" /> Finished Date Desc <img width="552" height="382" alt="image" src="https://github.com/user-attachments/assets/034d303f-37c9-4b3b-a189-57210fb2e805" /> Filters + Sort Options: Progress.In-Progress + Started Date <img width="554" height="225" alt="image" src="https://github.com/user-attachments/assets/6cd84cab-1b90-4c00-9ac0-2002416bc66d" /> Progress.In-Progress + Finished Date <img width="561" height="223" alt="image" src="https://github.com/user-attachments/assets/eb94113d-600e-434c-978e-d58cd52e3d1e" /> Progress.Finished + Started Date <img width="556" height="385" alt="image" src="https://github.com/user-attachments/assets/aefb620c-18f4-4065-9560-52664af6eea6" /> Progress.Finished + Finished Date <img width="553" height="386" alt="image" src="https://github.com/user-attachments/assets/be926cee-bb93-4967-b3c5-f5f76a741645" /> --- <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:09 +02:00
adam closed this issue 2026-04-25 00:19:09 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4290