From 7448e9828b1a55a3b98bcb1248e860c09529c861 Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Sun, 13 Oct 2024 11:38:49 -0700 Subject: [PATCH] Sort pages in archive order before writing CR metadata --- comicapi/tags/comicrack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comicapi/tags/comicrack.py b/comicapi/tags/comicrack.py index fdc4b4f..d0e89fb 100644 --- a/comicapi/tags/comicrack.py +++ b/comicapi/tags/comicrack.py @@ -266,7 +266,7 @@ class ComicRack(Tag): else: pages_node = ET.SubElement(root, "Pages") - for page in md.pages: + for page in sorted(md.pages, key=lambda x: x.archive_index): page_node = ET.SubElement(pages_node, "Page") page_node.attrib = {"Image": str(page.display_index)} if page.bookmark: