From 74397308075a29d351d47aff8973daeb487248c9 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Sat, 7 Sep 2024 03:33:45 +0200 Subject: [PATCH] Fix passport icons count logic --- indexer/src/models.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/indexer/src/models.py b/indexer/src/models.py index ec681bd..e39445b 100644 --- a/indexer/src/models.py +++ b/indexer/src/models.py @@ -265,11 +265,16 @@ def parse(self, packpath: str) -> Pack: icons += 1 elif icon.is_file() and icon.suffix in (".png", ".bmx"): if icon_set.name == "Passport": - parts = icon.name.split("_") - if len(parts) < 3: # passport_128x64 + if icon.stem == "passport_128x64": passport.add("Background") + elif icon.stem in ( + "passport_bad_46x49", + "passport_happy_46x49", + "passport_okay_46x49", + ): + passport.add(icon.stem.split("_")[1].title()) else: - passport.add(parts[1].title()) + icons += 1 else: icons += 1 if (pack_entry / "Fonts").is_dir():