diff --git a/wrolpi/files/ebooks.py b/wrolpi/files/ebooks.py index e84068b9..a17ccd6f 100644 --- a/wrolpi/files/ebooks.py +++ b/wrolpi/files/ebooks.py @@ -202,7 +202,7 @@ class EBook(ModelHelper, Base): logger.warning(f'Unable to generate cover for {self.ebook_path}') -def model_ebook(ebook: EBook, files: List[File]) -> EBook: +def _model_ebook(ebook: EBook, files: List[File]) -> EBook: """Creates an EBook model based off a File. Searches for it's cover in the provided `files`.""" # Multiple formats may share this cover. cover_file = next((i for i in files if i.mimetype.split('/')[0] == 'image'), None) @@ -270,7 +270,7 @@ def ebook_modeler(groups: Dict[str, List[File]], session: Session): if not ebook: ebook = EBook(ebook_file=ebook_file) session.add(ebook) - model_ebook(ebook, group) + _model_ebook(ebook, group) # Remove this group, it will not be processed by other modelers. del groups[stem] diff --git a/wrolpi/files/pdfs.py b/wrolpi/files/pdfs.py index 5d3dc329..3633c067 100644 --- a/wrolpi/files/pdfs.py +++ b/wrolpi/files/pdfs.py @@ -21,7 +21,7 @@ def get_pdf_title(path: pathlib.Path) -> Optional[str]: @register_modeler -def model_pdf(groups: Dict[str, List[File]], _: Session): +def pdf_modeler(groups: Dict[str, List[File]], _: Session): """Reads the contents of a PDF and extracts the title, attaches the title to the File. This modeler does not claim any groups passed to it. Does NOT mark the PDFs as indexed."""