mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-22 03:39:37 +00:00
Updated logic in compareUpdateLibraryFile
This commit is contained in:
parent
974e17ee3e
commit
ebdd5549ba
4 changed files with 89 additions and 25 deletions
|
|
@ -243,7 +243,7 @@ class LibraryItemScanData {
|
|||
} else {
|
||||
libraryFilesAdded = libraryFilesAdded.filter((lf) => lf !== matchingLibraryFile)
|
||||
let existingLibraryFileBefore = structuredClone(existingLibraryFile)
|
||||
if (this.compareUpdateLibraryFile(existingLibraryItem.path, existingLibraryFile, matchingLibraryFile, libraryScan)) {
|
||||
if (LibraryItemScanData.compareUpdateLibraryFile(existingLibraryItem.path, existingLibraryFile, matchingLibraryFile, libraryScan)) {
|
||||
this.libraryFilesModified.push({ old: existingLibraryFileBefore, new: existingLibraryFile })
|
||||
this.hasChanges = true
|
||||
}
|
||||
|
|
@ -289,10 +289,10 @@ class LibraryItemScanData {
|
|||
* @param {string} libraryItemPath
|
||||
* @param {LibraryItem.LibraryFileObject} existingLibraryFile
|
||||
* @param {import('../objects/files/LibraryFile')} scannedLibraryFile
|
||||
* @param {import('./LibraryScan')} libraryScan
|
||||
* @param {import('./LibraryScan') | import('./ScanLogger')} libraryScan
|
||||
* @returns {boolean} false if no changes
|
||||
*/
|
||||
compareUpdateLibraryFile(libraryItemPath, existingLibraryFile, scannedLibraryFile, libraryScan) {
|
||||
static compareUpdateLibraryFile(libraryItemPath, existingLibraryFile, scannedLibraryFile, libraryScan) {
|
||||
let hasChanges = false
|
||||
|
||||
if (existingLibraryFile.ino !== scannedLibraryFile.ino && existingLibraryFile.deviceId !== scannedLibraryFile.deviceId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue