def _safe_get_metadata(self, book, field: str) -> str | None:
        """Safely extract metadata field from epub book."""
        try:
            return getattr(book, field, None) or getattr(book.opf, field, None)
        except Exception as e:
            logger.debug(f"Error getting {field} metadata: {e}")
            return None
Safely extract metadata field from epub book.
py/core/parsers/structured/epub_parser.py