Skip to content

Commit

Permalink
fixed an error when manually adding a playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
kiddac committed Dec 22, 2024
1 parent 059d8d8 commit 2618452
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CONTROL/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: enigma2-plugin-extensions-xklass
Version: 1.29-20241218
Version: 1.30-20241222
Section: misc
Priority: optional
Architecture: all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def userInfo(self):
from . import serverinfo
if "user_info" in glob.active_playlist:
if "auth" in glob.active_playlist["user_info"]:
if glob.active_playlist["user_info"]["auth"] == 1:
if str(glob.active_playlist["user_info"]["auth"]) == "1":
self.session.openWithCallback(self.callback, serverinfo.XKlass_UserInfo)

def showPlaylists(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ def createSetup(self):
expires = datetime.fromtimestamp(int(exp_date)).strftime("%d-%m-%Y")
except:
expires = "Null"
else:
expires = "Null"

active = str(_("Active Conn:"))
activenum = playlist["user_info"]["active_cons"]
Expand Down Expand Up @@ -489,7 +491,7 @@ def openUserInfo(self):
self.session.open(serverinfo.XKlass_UserInfo)

def closePlaylists(self):
if "user_info" in glob.active_playlist and "auth" in glob.active_playlist["user_info"] and glob.active_playlist["user_info"]["auth"] == 1 and glob.active_playlist["user_info"]["status"] == "Active":
if "user_info" in glob.active_playlist and "auth" in glob.active_playlist["user_info"] and str(glob.active_playlist["user_info"]["auth"]) == "1" and glob.active_playlist["user_info"]["status"] == "Active":
cfg.lastplaylist.setValue(str(glob.active_playlist["playlist_info"]["name"]))
cfg.save()
configfile.save()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ def checkline(self):
try:
response = http.get(self.apiline, headers=hdr, timeout=30, verify=False, stream=True)
response.raise_for_status()
if r.status_code == requests.codes.ok or r.status_code == 206:
if response.status_code == requests.codes.ok or response.status_code == 206:
try:
json_response = response.json()
if "user_info" in json_response and "auth" in json_response["user_info"]:
valid = json_response["user_info"]["auth"] == 1
valid = str(json_response["user_info"]["auth"]) == "1"
except ValueError:
pass
except Exception as e:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.29-20241218
1.30-20241222

0 comments on commit 2618452

Please sign in to comment.