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 729b6aa62a
commit b2ce6023a2
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(): if not filename.is_file():
logger.error(f"File {str(filename)} not readable.") logger.error(f"File {str(filename)} not readable.")
return False 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]: def run(self, filename: Path) -> list[Annotation]:
"""Extract annotations from a file. """Extract annotations from a file.

View file

@ -20,11 +20,13 @@ class PocketBookExtractor:
return False return False
html = BeautifulSoup(content, features="xml") html = BeautifulSoup(content, features="xml")
return bool( if not html.find(
html.find(
"meta", {"name": "generator", "content": "PocketBook Bookmarks Export"} "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]: def run(self, filename: Path) -> list[Annotation]:
"""Extract annotations from pocketbook html file. """Extract annotations from pocketbook html file.

View file

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