mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Merge pull request #4469 from advplyr/fix_scanner_deleting_single_file_books
Fix scanner after deleting single file books #4459
This commit is contained in:
		
						commit
						9c0c7b6b08
					
				@ -206,6 +206,11 @@ class LibraryItemScanner {
 | 
			
		||||
  async scanPotentialNewLibraryItem(libraryItemPath, library, folder, isSingleMediaItem) {
 | 
			
		||||
    const libraryItemScanData = await this.getLibraryItemScanData(libraryItemPath, library, folder, isSingleMediaItem)
 | 
			
		||||
 | 
			
		||||
    if (!libraryItemScanData.libraryFiles.length) {
 | 
			
		||||
      Logger.info(`[LibraryItemScanner] Library item at path "${libraryItemPath}" has no files - ignoring`)
 | 
			
		||||
      return null
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const scanLogger = new ScanLogger()
 | 
			
		||||
    scanLogger.verbose = true
 | 
			
		||||
    scanLogger.setData('libraryItem', libraryItemScanData.relPath)
 | 
			
		||||
 | 
			
		||||
@ -606,6 +606,11 @@ class LibraryScanner {
 | 
			
		||||
      } else if (library.settings.audiobooksOnly && !hasAudioFiles(fileUpdateGroup, itemDir)) {
 | 
			
		||||
        Logger.debug(`[LibraryScanner] Folder update for relative path "${itemDir}" has no audio files`)
 | 
			
		||||
        continue
 | 
			
		||||
      } else if (!(await fs.pathExists(fullPath))) {
 | 
			
		||||
        Logger.info(`[LibraryScanner] File update group "${itemDir}" does not exist - ignoring`)
 | 
			
		||||
 | 
			
		||||
        itemGroupingResults[itemDir] = ScanResult.NOTHING
 | 
			
		||||
        continue
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      // Check if a library item is a subdirectory of this dir
 | 
			
		||||
 | 
			
		||||
@ -109,7 +109,7 @@ function getIno(path) {
 | 
			
		||||
    .stat(path, { bigint: true })
 | 
			
		||||
    .then((data) => String(data.ino))
 | 
			
		||||
    .catch((err) => {
 | 
			
		||||
      Logger.error('[Utils] Failed to get ino for path', path, err)
 | 
			
		||||
      Logger.warn(`[Utils] Failed to get ino for path "${path}"`, err)
 | 
			
		||||
      return null
 | 
			
		||||
    })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user