mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-31 16:24:45 +02:00
Fix:Podcast episodes duplicated when a scan runs while the episode is downloading #2785
This commit is contained in:
parent
a5ebd89817
commit
850ed48955
5 changed files with 40 additions and 6 deletions
|
@ -4,7 +4,9 @@ const { LogLevel, ScanResult } = require('../utils/constants')
|
|||
const fileUtils = require('../utils/fileUtils')
|
||||
const scanUtils = require('../utils/scandir')
|
||||
const libraryFilters = require('../utils/queries/libraryFilters')
|
||||
const Logger = require('../Logger')
|
||||
const Database = require('../Database')
|
||||
const Watcher = require('../Watcher')
|
||||
const LibraryScan = require('./LibraryScan')
|
||||
const LibraryItemScanData = require('./LibraryItemScanData')
|
||||
const BookScanner = require('./BookScanner')
|
||||
|
@ -128,6 +130,13 @@ class LibraryItemScanner {
|
|||
const libraryFiles = []
|
||||
for (let i = 0; i < fileItems.length; i++) {
|
||||
const fileItem = fileItems[i]
|
||||
|
||||
if (Watcher.checkShouldIgnoreFilePath(fileItem.fullpath)) {
|
||||
// Skip file if it's pending
|
||||
Logger.info(`[LibraryItemScanner] Skipping watcher pending file "${fileItem.fullpath}" during scan of library item path "${libraryItemPath}"`)
|
||||
continue
|
||||
}
|
||||
|
||||
const newLibraryFile = new LibraryFile()
|
||||
// fileItem.path is the relative path
|
||||
await newLibraryFile.setDataFromPath(fileItem.fullpath, fileItem.path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue