Skip to content

Commit

Permalink
optimistic check when scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMendolia committed Sep 19, 2023
1 parent 2a5a29f commit deb5a8e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Command/BooksScanCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int
try {
$flush = false;
$progressBar->setMessage($file->getFilename());
$book = $this->bookRepository->findOneBy(
[
'bookPath' => $this->fileSystemManager->getFolderName($file),
'bookFilename' => $file->getFilename(),
]);

if (null !== $book) {
unset($unprocessedBooks[$book->getChecksum()]);
continue;
}

$checksum = $this->fileSystemManager->getFileChecksum($file);
$book = $this->bookRepository->findOneBy(['checksum' => $checksum]);
if (null === $book) {
Expand Down

0 comments on commit deb5a8e

Please sign in to comment.