diff --git a/Dockerfile b/Dockerfile index b44da74..570259a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,6 @@ RUN cd frontend \ && rm -r node_modules -RUN cat /src/cbreader/crontab >> /etc/cron.daily/cbreader +RUN cat /src/cbreader/crontab >> /etc/crontab EXPOSE 8000 diff --git a/cbreader/crontab b/cbreader/crontab index f5e86b6..7ef4832 100644 --- a/cbreader/crontab +++ b/cbreader/crontab @@ -1 +1 @@ -*/15 * * * * python /src/manage.py scan_comics --settings=cbreader.settings.base \ No newline at end of file +*/15 * * * * root /src/.venv/bin/python /src/manage.py scan_comics --settings=cbreader.settings.base diff --git a/comic/processing.py b/comic/processing.py index dd9d750..73acaa7 100644 --- a/comic/processing.py +++ b/comic/processing.py @@ -85,13 +85,14 @@ def clean_files(files: QuerySet, user: AbstractBaseUser, dir_path: Path, directo for new_comic in file_list - files_db_set: if new_comic.suffix.lower() in settings.SUPPORTED_FILES: new_book = models.ComicBook(file_name=new_comic.name, directory=directory) - archive, archive_type = new_book.get_archive() try: + archive, archive_type = new_book.get_archive() if archive_type == 'archive': new_book.page_count = len(get_archive_files(archive)) elif archive_type == 'pdf': new_book.page_count = archive.page_count except NotCompatibleArchive: + # Unreadable/corrupt archive - index the file with no page count pass books_to_add.append(new_book) models.ComicBook.objects.bulk_create(books_to_add)