From 4d8d9eb6682b32533a5478b061503367cb177314 Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Wed, 22 Jun 2022 17:15:58 +0200 Subject: [PATCH] possible fix for #1 --- exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter.py b/exporter.py index 529ad0c..ac899cc 100644 --- a/exporter.py +++ b/exporter.py @@ -156,7 +156,7 @@ for chapter_data in api_get_dict('chapters').get('data'): info("Getting info about Pages") for page_data in api_get_dict('pages').get('data'): parent_id = page_data.get('chapter_id') - if parent_id == 0: + if parent_id not in chapters.keys(): parent_id = page_data.get('book_id') info(f"Page \"{page_data.get('name')}\" is not in any chapter, " f"using Book \"{books.get(parent_id).get_name()}\" as a parent.")