Make sure number and version are integer in instruction number detection

This commit is contained in:
Gregoo 2025-01-23 08:45:58 +01:00
parent 71af15b16d
commit a84493908a

View File

@ -54,7 +54,14 @@ class BrickInstructions(object):
splits = normalized.split('-', 2) splits = normalized.split('-', 2)
if len(splits) >= 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 # Delete an instruction file
def delete(self, /) -> None: def delete(self, /) -> None: