mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Renaming function to match style.
This commit is contained in:
parent
18ec96a478
commit
d80e26caeb
2 changed files with 3 additions and 3 deletions
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue