Update progress started/finished sort query values

This commit is contained in:
advplyr 2025-08-24 16:26:28 -05:00
parent aea4df1ab9
commit f4b58bf435
3 changed files with 7 additions and 7 deletions

View File

@ -353,11 +353,11 @@ export default {
if (!this.userProgressLastUpdated) return '\u00A0' if (!this.userProgressLastUpdated) return '\u00A0'
return this.$getString('LabelLastProgressDate', [this.$formatDatetime(this.userProgressLastUpdated, this.dateFormat, this.timeFormat)]) 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' if (!this.userProgressStartedDate) return '\u00A0'
return this.$getString('LabelStartedDate', [this.$formatDatetime(this.userProgressStartedDate, this.dateFormat, this.timeFormat)]) 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' if (!this.userProgressFinishedDate) return '\u00A0'
return this.$getString('LabelFinishedDate', [this.$formatDatetime(this.userProgressFinishedDate, this.dateFormat, this.timeFormat)]) return this.$getString('LabelFinishedDate', [this.$formatDatetime(this.userProgressFinishedDate, this.dateFormat, this.timeFormat)])
} }

View File

@ -136,11 +136,11 @@ export default {
}, },
{ {
text: this.$strings.LabelLibrarySortByProgressStarted, text: this.$strings.LabelLibrarySortByProgressStarted,
value: 'startedDate' value: 'progress.createdAt'
}, },
{ {
text: this.$strings.LabelLibrarySortByProgressFinished, text: this.$strings.LabelLibrarySortByProgressFinished,
value: 'finishedDate' value: 'progress.finishedAt'
}, },
{ {
text: this.$strings.LabelRandomly, text: this.$strings.LabelRandomly,

View File

@ -290,9 +290,9 @@ module.exports = {
return [[Sequelize.literal(`CAST(\`series.bookSeries.sequence\` AS FLOAT) ${nullDir}`)]] return [[Sequelize.literal(`CAST(\`series.bookSeries.sequence\` AS FLOAT) ${nullDir}`)]]
} else if (sortBy === 'progress') { } else if (sortBy === 'progress') {
return [[Sequelize.literal(`mediaProgresses.updatedAt ${dir} NULLS LAST`)]] 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`)]] 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`)]] return [[Sequelize.literal(`mediaProgresses.finishedAt ${dir} NULLS LAST`)]]
} else if (sortBy === 'random') { } else if (sortBy === 'random') {
return [Database.sequelize.random()] return [Database.sequelize.random()]
@ -534,7 +534,7 @@ module.exports = {
} }
// When sorting by progress but not filtering by progress, include media progresses // 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({ bookIncludes.push({
model: Database.mediaProgressModel, model: Database.mediaProgressModel,
attributes: ['id', 'isFinished', 'currentTime', 'ebookProgress', 'updatedAt', 'createdAt', 'finishedAt'], attributes: ['id', 'isFinished', 'currentTime', 'ebookProgress', 'updatedAt', 'createdAt', 'finishedAt'],