forked from Cutlery/immich
		
	also check offline status
This commit is contained in:
		
							parent
							
								
									4ba95bb0a6
								
							
						
					
					
						commit
						95b57f082e
					
				@ -680,13 +680,13 @@ export class LibraryService extends EventEmitter {
 | 
				
			|||||||
      .filter((validation) => validation.isValid)
 | 
					      .filter((validation) => validation.isValid)
 | 
				
			||||||
      .map((validation) => validation.importPath);
 | 
					      .map((validation) => validation.importPath);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    await this.handleQueueOfflineScan(job);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const generator = this.storageRepository.walk({
 | 
					    const generator = this.storageRepository.walk({
 | 
				
			||||||
      pathsToCrawl: validImportPaths,
 | 
					      pathsToCrawl: validImportPaths,
 | 
				
			||||||
      exclusionPatterns: library.exclusionPatterns,
 | 
					      exclusionPatterns: library.exclusionPatterns,
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const shouldScanAll = job.refreshAllFiles || job.refreshModifiedFiles;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    let crawledAssetPaths: string[] = [];
 | 
					    let crawledAssetPaths: string[] = [];
 | 
				
			||||||
    let assetIdsToMarkOnline: string[] = [];
 | 
					    let assetIdsToMarkOnline: string[] = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -698,15 +698,12 @@ export class LibraryService extends EventEmitter {
 | 
				
			|||||||
        await this.assetRepository.updateAll(assetIdsToMarkOnline, { isOffline: false });
 | 
					        await this.assetRepository.updateAll(assetIdsToMarkOnline, { isOffline: false });
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      this.logger.log(`Queuing refresh for ${crawledAssetPaths.length} asset(s) in library ${job.id}`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      await this.scanAssets(job.id, crawledAssetPaths, library.ownerId, job.refreshAllFiles ?? false);
 | 
					      await this.scanAssets(job.id, crawledAssetPaths, library.ownerId, job.refreshAllFiles ?? false);
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for await (const filePath of generator) {
 | 
					    for await (const filePath of generator) {
 | 
				
			||||||
      const asset = await this.assetRepository.getByLibraryIdAndOriginalPath(job.id, filePath);
 | 
					 | 
				
			||||||
      if (asset && asset.isOffline) {
 | 
					 | 
				
			||||||
        // Mark this asset as online
 | 
					 | 
				
			||||||
        assetIdsToMarkOnline.push(asset.id);
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      crawledAssetPaths.push(filePath);
 | 
					      crawledAssetPaths.push(filePath);
 | 
				
			||||||
      pathCounter++;
 | 
					      pathCounter++;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user