Renaming function to match style.

This commit is contained in:
Roland 2022-12-23 16:10:51 -07:00
parent 18ec96a478
commit d80e26caeb
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 3 additions and 3 deletions

View file

@ -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]

View file

@ -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."""