From 351e65483647a6f9b0e44418ae97294b5e72af31 Mon Sep 17 00:00:00 2001 From: b123400 Date: Thu, 22 May 2025 23:40:41 +0900 Subject: [PATCH] Handle unexpected suffix "-rbl" Some apps updated via Rebble have the suffix "-rbl", e.g. "1.0-rbl". `int("0-rbl")` raises an exception, making it impossible to update to "1.1" --- appstore/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/appstore/utils.py b/appstore/utils.py index 699fff2..514fe5a 100644 --- a/appstore/utils.py +++ b/appstore/utils.py @@ -513,7 +513,10 @@ def first_version_is_newer(current_release, old_release): for i in range(len(sections_current)): try: current = int(sections_current[i]) - old = int(sections_old[i]) + # Some apps updated manually via Rebble have the "-rbl" suffix, e.g. "1.0-rbl" + # We have to remove the suffix here otherwise the comparison always fail + old_numeric_part = sections_old[i].split("-")[0] + old = int(old_numeric_part) if current > old: return True elif old > current: