chore: Log found files for extractors to debug logger

This commit is contained in:
Marty Oehme 2025-09-11 21:37:18 +02:00
parent a9ff4152af
commit fd71482526
Signed by: Marty
GPG key ID: 4E535BC19C61886E
3 changed files with 14 additions and 7 deletions

View file

@ -25,7 +25,12 @@ class PdfExtractor:
if not filename.is_file():
logger.error(f"File {str(filename)} not readable.")
return False
return self._is_pdf(filename)
if not self._is_pdf(filename):
return False
logger.debug(f"Found processable annotation file: {filename}")
return True
def run(self, filename: Path) -> list[Annotation]:
"""Extract annotations from a file.

View file

@ -20,11 +20,13 @@ class PocketBookExtractor:
return False
html = BeautifulSoup(content, features="xml")
return bool(
html.find(
"meta", {"name": "generator", "content": "PocketBook Bookmarks Export"}
)
)
if not html.find(
"meta", {"name": "generator", "content": "PocketBook Bookmarks Export"}
):
return False
logger.debug(f"Found processable annotation file: {filename}")
return True
def run(self, filename: Path) -> list[Annotation]:
"""Extract annotations from pocketbook html file.

View file

@ -37,7 +37,7 @@ class ReadEraExtractor:
return False
logger.debug(
f"Found annotation file processable with ReadEraExtractor: {filename}"
f"Found processable annotation file: {filename}"
)
return True