Added deviceId in addition to inode to uniquely identify files

This commit is contained in:
Jason Axley 2025-08-15 09:09:06 -07:00
parent d8f07eb956
commit 3a4aacb7bf
17 changed files with 1445 additions and 227 deletions

View file

@ -0,0 +1,23 @@
// TODO - need to check
// compareUpdateLibraryFile
// checkEbookFileRemoved
// checkAudioFileRemoved
// libraryItemObject()
/*
new LibraryItemScanData({
libraryFolderId: folder.id,
libraryId: library.id,
mediaType: library.mediaType,
ino: libraryItemStats.ino,
deviceId: libraryItemStats.dev,
mtimeMs: libraryItemStats.mtimeMs || 0,
ctimeMs: libraryItemStats.ctimeMs || 0,
birthtimeMs: libraryItemStats.birthtimeMs || 0,
path: libraryItemData.path,
relPath: libraryItemData.relPath,
isFile: isSingleMediaItem,
mediaMetadata: libraryItemData.mediaMetadata || null,
libraryFiles
})
*/

View file

@ -0,0 +1,9 @@
const LibraryFile = require('../../../server/objects/files/LibraryFile')
const EBookFile = require('../../../server/objects/files/EBookFile')
const AudioFile = require('../../../server/objects/files/AudioFile')
const LibraryItem = require('../../../server/models/LibraryItem')
const LibraryItemScanData = require('../../../server/scanner/LibraryItemScanData')
// TODO: all of these duplicate each other. Need to verify that deviceId is set on each when constructing. And that deviceId is populated when using toJSON()
// TODO: check that any libraryFiles properties set to JSON contain a LibraryFile which has a deviceId property