Fix:Book library sort by publishedYear #3620

- Updated sort to cast publishedYear to INTEGER
This commit is contained in:
advplyr 2024-11-17 16:00:44 -06:00
parent 46a3c3de33
commit 75eef8d722

View File

@ -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') {