mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-04 06:59:41 +00:00
feat: implement duplicate title normalized filter
This commit is contained in:
parent
aa85106681
commit
ead215e777
13 changed files with 276 additions and 1 deletions
|
|
@ -515,6 +515,10 @@ module.exports = {
|
|||
isInvalid: true
|
||||
}
|
||||
]
|
||||
} else if (filterGroup === 'duplicates') {
|
||||
libraryItemWhere['titleNormalized'] = {
|
||||
[Sequelize.Op.in]: Sequelize.literal(`(SELECT titleNormalized FROM libraryItems WHERE libraryId = '${libraryId}' AND titleNormalized IS NOT NULL AND titleNormalized != '' GROUP BY titleNormalized HAVING COUNT(titleNormalized) > 1)`)
|
||||
}
|
||||
} else if (filterGroup === 'progress' && user) {
|
||||
const mediaProgressWhere = {
|
||||
userId: user.id
|
||||
|
|
|
|||
|
|
@ -168,6 +168,10 @@ module.exports = {
|
|||
isInvalid: true
|
||||
}
|
||||
]
|
||||
} else if (filterGroup === 'duplicates') {
|
||||
libraryItemWhere['titleNormalized'] = {
|
||||
[Sequelize.Op.in]: Sequelize.literal(`(SELECT titleNormalized FROM libraryItems WHERE libraryId = '${libraryId}' AND titleNormalized IS NOT NULL AND titleNormalized != '' GROUP BY titleNormalized HAVING COUNT(titleNormalized) > 1)`)
|
||||
}
|
||||
} else if (filterGroup === 'recent') {
|
||||
libraryItemWhere['createdAt'] = {
|
||||
[Sequelize.Op.gte]: new Date(new Date() - 60 * 24 * 60 * 60 * 1000) // 60 days ago
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue