chore: use force instead of forceRefresh (#4394)

This commit is contained in:
Jason Rasmussen 2023-10-08 23:16:13 -04:00 committed by GitHub
parent 687d896c63
commit d8e66acd02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 23 deletions

View file

@ -186,7 +186,7 @@ export class LibraryService {
let doImport = false;
let doRefresh = false;
if (job.forceRefresh) {
if (job.force) {
doRefresh = true;
}
@ -200,7 +200,7 @@ export class LibraryService {
`File modification time has changed, re-importing asset: ${assetPath}. Old mtime: ${existingAssetEntity.fileModifiedAt}. New mtime: ${stats.mtime}`,
);
doRefresh = true;
} else if (!job.forceRefresh && stats && !existingAssetEntity.isOffline) {
} else if (!job.force && stats && !existingAssetEntity.isOffline) {
// Asset exists on disk and in db and mtime has not changed. Also, we are not forcing refresn. Therefore, do nothing
this.logger.debug(`Asset already exists in database and on disk, will not import: ${assetPath}`);
}
@ -410,7 +410,7 @@ export class LibraryService {
id: job.id,
assetPath: path.normalize(assetPath),
ownerId: library.ownerId,
forceRefresh: job.refreshAllFiles ?? false,
force: job.refreshAllFiles ?? false,
};
await this.jobRepository.queue({ name: JobName.LIBRARY_SCAN_ASSET, data: libraryJobData });