mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-29 23:29:38 +00:00
Added deviceId sequelize migration and completed unit tests
This commit is contained in:
parent
423f2d311e
commit
41a288bcdf
10 changed files with 451 additions and 29 deletions
|
|
@ -724,12 +724,25 @@ async function findLibraryItemByFileToItemInoMatch(libraryId, fullPath, isSingle
|
|||
/** @type {import('../models/LibraryItem').LibraryItemExpanded | null} */
|
||||
let existingLibraryItem = null
|
||||
for (let item in itemFileInos) {
|
||||
// TODO: BUGBUG - this query is broken. It's passing a whole object instead of just the ino. Change the query.
|
||||
|
||||
existingLibraryItem = await Database.libraryItemModel.findOneExpanded({
|
||||
libraryId: libraryId,
|
||||
ino: {
|
||||
[sequelize.Op.in]: itemFileInos
|
||||
}
|
||||
[sequelize.Op.or]: itemFileInos
|
||||
})
|
||||
|
||||
/* existingLibraryItem = await Database.libraryItemModel.findOneExpanded([
|
||||
{
|
||||
libraryId: libraryId,
|
||||
[sequelize.Op.and]: {
|
||||
ino: itemFileInos.map((f) => f.ino),
|
||||
deviceId: itemFileInos.map((f) => f.deviceId)
|
||||
}
|
||||
}
|
||||
/* ino: {
|
||||
[sequelize.Op.in]: itemFileInos
|
||||
} */
|
||||
// ]) */
|
||||
if (existingLibraryItem) {
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue