From a84493908afb481090fede7f775a0c73a581600c Mon Sep 17 00:00:00 2001 From: Gregoo Date: Thu, 23 Jan 2025 08:45:58 +0100 Subject: [PATCH] Make sure number and version are integer in instruction number detection --- bricktracker/instructions.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bricktracker/instructions.py b/bricktracker/instructions.py index e70f484..daf2c35 100644 --- a/bricktracker/instructions.py +++ b/bricktracker/instructions.py @@ -54,7 +54,14 @@ class BrickInstructions(object): splits = normalized.split('-', 2) if len(splits) >= 2: - self.number = '-'.join(splits[:2]) + try: + # Trying to make sense of each part as integers + int(splits[0]) + int(splits[1]) + + self.set = '-'.join(splits[:2]) + except Exception: + pass # Delete an instruction file def delete(self, /) -> None: