Fix PDF generation for non-vanishing collection path

This commit is contained in:
iburadempa 2024-12-06 04:55:27 +01:00
parent 62bb338898
commit 1ee58510df

View file

@ -110,7 +110,7 @@ def get_settings():
settings_path = config_dir / 'settings.json'
try:
with open(settings_path, 'r') as file:
setting_cache = json.loads(file.read())
settings_cache = json.loads(file.read())
return deepcopy(settings_cache or {})
except Exception as err:
logger.exception(err)
@ -569,7 +569,8 @@ async def create_pdf(pages, lossy: bool = False, ocr: bool = False):
for p in cache_dir_pdf.iterdir():
p.unlink()
img_paths = [str(archive_dir / f'{page}.png') for page in pages]
collection_choice = Path(get_settings().get('collection_choice', '.'))
img_paths = [str(archive_dir / collection_choice / f'{page}.png') for page in pages]
if lossy:
cmd = [