From b82b68c8b240377a6192bef6cdfac50802f0c166 Mon Sep 17 00:00:00 2001 From: Frikky Date: Wed, 24 Jan 2024 12:06:48 +0100 Subject: [PATCH] https://github.com/Shuffle/Shuffle/issues/1306: Fixed int casting issue in app sdk during list management --- backend/app_sdk/app_base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index a1a57375..3a8d2634 100755 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -2073,9 +2073,9 @@ class AppBase: # Means it's a single item -> continue if seconditem == "": print("[INFO] In first - handling %s. Len: %d" % (firstitem, len(basejson))) - if firstitem.lower() == "max" or firstitem.lower() == "last" or firstitem.lower() == "end": + if str(firstitem).lower() == "max" or str(firstitem).lower() == "last" or str(firstitem).lower() == "end": firstitem = len(basejson)-1 - elif firstitem.lower() == "min" or firstitem.lower() == "first": + elif str(firstitem).lower() == "min" or str(firstitem).lower() == "first": firstitem = 0 else: firstitem = int(firstitem) @@ -2099,9 +2099,9 @@ class AppBase: firstitem = int(firstitem) if isinstance(seconditem, str): - if seconditem.lower() == "max" or seconditem.lower() == "last" or firstitem.lower() == "end": + if str(seconditem).lower() == "max" or str(seconditem).lower() == "last" or str(firstitem).lower() == "end": seconditem = len(basejson)-1 - elif seconditem.lower() == "min" or seconditem.lower() == "first": + elif str(seconditem).lower() == "min" or str(seconditem).lower() == "first": seconditem = 0 else: seconditem = int(seconditem)