diff --git a/src/Command/BooksScanCommand.php b/src/Command/BooksScanCommand.php index 320e853e..9e269b58 100644 --- a/src/Command/BooksScanCommand.php +++ b/src/Command/BooksScanCommand.php @@ -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) {