Skip to content

Commit

Permalink
Fix:Book library sort by publishedYear #3620
Browse files Browse the repository at this point in the history
- Updated sort to cast publishedYear to INTEGER
  • Loading branch information
advplyr committed Nov 17, 2024
1 parent 46a3c3d commit 75eef8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/utils/queries/libraryItemsBookFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ module.exports = {
} else if (sortBy === 'media.duration') {
return [['duration', dir]]
} else if (sortBy === 'media.metadata.publishedYear') {
return [['publishedYear', dir]]
return [[Sequelize.literal(`CAST(\`book\`.\`publishedYear\` AS INTEGER)`), dir]]
} else if (sortBy === 'media.metadata.authorNameLF') {
return [[Sequelize.literal('author_name COLLATE NOCASE'), dir]]
} else if (sortBy === 'media.metadata.authorName') {
Expand Down

0 comments on commit 75eef8d

Please sign in to comment.