This commit is contained in:
carlospolop 2025-08-19 17:11:01 +02:00
parent 524daa1695
commit 255b44a27b

View File

@ -62,9 +62,10 @@ def ref(matchobj):
logger.debug(f'Recursive title search result: {chapter["name"]}') logger.debug(f'Recursive title search result: {chapter["name"]}')
title = chapter['name'] title = chapter['name']
except Exception as e: except Exception as e:
dir = path.dirname(current_chapter['source_path'])
rel_path = path.normpath(path.join(dir,href))
try: try:
dir = path.dirname(current_chapter['source_path']) logger.debug(f'Error getting chapter title: {href} trying with relative path {rel_path}')
logger.debug(f'Error getting chapter title: {href} trying with relative path {path.normpath(path.join(dir,href))}')
if "#" in href: if "#" in href:
chapter, _path = findtitle(path.normpath(path.join(dir,href.split('#')[0])), book, "source_path") chapter, _path = findtitle(path.normpath(path.join(dir,href.split('#')[0])), book, "source_path")
title = " ".join(href.split("#")[1].split("-")).title() title = " ".join(href.split("#")[1].split("-")).title()
@ -75,7 +76,7 @@ def ref(matchobj):
logger.debug(f'Recursive title search result: {chapter["name"]}') logger.debug(f'Recursive title search result: {chapter["name"]}')
except Exception as e: except Exception as e:
logger.debug(e) logger.debug(e)
logger.error(f'Error getting chapter title: {path.normpath(path.join(dir,Error getting chapter title))}') logger.error(f'Error getting chapter title: {rel_path}')
sys.exit(1) sys.exit(1)