From f4b58bf435baf92d876811a88ff0d5056773697c Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 24 Aug 2025 16:26:28 -0500 Subject: [PATCH] Update progress started/finished sort query values --- client/components/cards/LazyBookCard.vue | 4 ++-- client/components/controls/LibrarySortSelect.vue | 4 ++-- server/utils/queries/libraryItemsBookFilters.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue index 0c4cbf8ed..fbb50bb14 100644 --- a/client/components/cards/LazyBookCard.vue +++ b/client/components/cards/LazyBookCard.vue @@ -353,11 +353,11 @@ export default { if (!this.userProgressLastUpdated) return '\u00A0' return this.$getString('LabelLastProgressDate', [this.$formatDatetime(this.userProgressLastUpdated, this.dateFormat, this.timeFormat)]) } - if (this.orderBy === 'startedDate') { + if (this.orderBy === 'progress.createdAt') { if (!this.userProgressStartedDate) return '\u00A0' return this.$getString('LabelStartedDate', [this.$formatDatetime(this.userProgressStartedDate, this.dateFormat, this.timeFormat)]) } - if (this.orderBy === 'finishedDate') { + if (this.orderBy === 'progress.finishedAt') { if (!this.userProgressFinishedDate) return '\u00A0' return this.$getString('LabelFinishedDate', [this.$formatDatetime(this.userProgressFinishedDate, this.dateFormat, this.timeFormat)]) } diff --git a/client/components/controls/LibrarySortSelect.vue b/client/components/controls/LibrarySortSelect.vue index ef98cdbc3..a0734d6a4 100644 --- a/client/components/controls/LibrarySortSelect.vue +++ b/client/components/controls/LibrarySortSelect.vue @@ -136,11 +136,11 @@ export default { }, { text: this.$strings.LabelLibrarySortByProgressStarted, - value: 'startedDate' + value: 'progress.createdAt' }, { text: this.$strings.LabelLibrarySortByProgressFinished, - value: 'finishedDate' + value: 'progress.finishedAt' }, { text: this.$strings.LabelRandomly, diff --git a/server/utils/queries/libraryItemsBookFilters.js b/server/utils/queries/libraryItemsBookFilters.js index 9750ce6bb..494a9564f 100644 --- a/server/utils/queries/libraryItemsBookFilters.js +++ b/server/utils/queries/libraryItemsBookFilters.js @@ -290,9 +290,9 @@ module.exports = { return [[Sequelize.literal(`CAST(\`series.bookSeries.sequence\` AS FLOAT) ${nullDir}`)]] } else if (sortBy === 'progress') { return [[Sequelize.literal(`mediaProgresses.updatedAt ${dir} NULLS LAST`)]] - } else if (sortBy === 'startedDate') { + } else if (sortBy === 'progress.createdAt') { return [[Sequelize.literal(`mediaProgresses.createdAt ${dir} NULLS LAST`)]] - } else if (sortBy === 'finishedDate') { + } else if (sortBy === 'progress.finishedAt') { return [[Sequelize.literal(`mediaProgresses.finishedAt ${dir} NULLS LAST`)]] } else if (sortBy === 'random') { return [Database.sequelize.random()] @@ -534,7 +534,7 @@ module.exports = { } // When sorting by progress but not filtering by progress, include media progresses - if (filterGroup !== 'progress' && ['startedDate', 'finishedDate', 'progress'].includes(sortBy)) { + if (filterGroup !== 'progress' && ['progress.createdAt', 'progress.finishedAt', 'progress'].includes(sortBy)) { bookIncludes.push({ model: Database.mediaProgressModel, attributes: ['id', 'isFinished', 'currentTime', 'ebookProgress', 'updatedAt', 'createdAt', 'finishedAt'],