diff --git a/wrolpi/files/ebooks.py b/wrolpi/files/ebooks.py index c7e261ed..2bcc366a 100644 --- a/wrolpi/files/ebooks.py +++ b/wrolpi/files/ebooks.py @@ -213,14 +213,14 @@ def _model_ebook(ebook: EBook) -> EBook: size = ebook_file.stat().st_size # Only index if it hasn't been done, or if the file has changed. - changed = size != ebook.size or not ebook.title + changed = size != ebook.size or not ebook.file_group.title if epub_file and changed: # Only read the contents of the file if it has changed. try: data = extract_ebook_data(ebook_file, ebook_mimetype) if data: # Title is a_text. - ebook.file_group.title = ebook.file_group.a_text = ebook.title = data.title + ebook.file_group.title = ebook.file_group.a_text = data.title # Creator is b_text. ebook.file_group.b_text = ebook.creator = data.creator # All text is d_text. @@ -282,7 +282,7 @@ async def ebook_modeler(): file_group.model = EBook.__tablename__ file_group.indexed = True except Exception as e: - logger.error(f'Failed to index ebook {file_group}') + logger.error(f'Failed to index ebook {file_group}', exc_info=e) if PYTEST: raise diff --git a/wrolpi/files/lib.py b/wrolpi/files/lib.py index bae944b6..70e2c65a 100644 --- a/wrolpi/files/lib.py +++ b/wrolpi/files/lib.py @@ -336,8 +336,7 @@ def _upsert_files(files: List[pathlib.Path], idempotency: datetime.datetime): curs.execute(stmt) need_index = [i[0] for i in curs.fetchall() if i[1] is False] if need_index: - logger.info(f'Invalidated indexes of {len(need_index)} file groups') - logger.debug(f'Invalidated indexes of file groups {need_index}') + refresh_logger.info(f'Invalidated indexes of {len(need_index)} file groups') async def refresh_discover_paths(paths: List[pathlib.Path], idempotency: datetime.datetime = None): @@ -398,7 +397,7 @@ async def refresh_discover_paths(paths: List[pathlib.Path], idempotency: datetim -- Delete any files in the refreshed paths that were not updated. {" OR " + wheres if deleted_files else wheres} ''' - logger.debug(stmt) + refresh_logger.debug(stmt) curs.execute(stmt)