Merge 3838d0f8360ee8c86a4f5b17dd0b57a2eba451f2 into 3ba27ffc371d6087b58314231d9bc291a0d163c2

This commit is contained in:
Thomas Price 2025-02-23 12:54:07 +00:00 committed by GitHub
commit d9f3b71230
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -46,6 +46,9 @@ class AudioscrobblerLegacy(APIHandler):
key = apikeystore[client]
if self.check_token(auth,key,timestamp):
sessionkey = self.generate_key(client)
if ':' not in host:
port = 80 if protocol == 'http' else 443
host = f"{host}:{port}"
return 200, (
"OK\n"
f"{sessionkey}\n"
@ -109,7 +112,7 @@ class AudioscrobblerLegacy(APIHandler):
str(
random.choice(
list(range(10)) + list("abcdefghijklmnopqrstuvwxyz") +
list("ABCDEFGHIJKLMNOPQRSTUVWXYZ"))) for _ in range(64))
list("ABCDEFGHIJKLMNOPQRSTUVWXYZ"))) for _ in range(32))
self.mobile_sessions[key] = client
return key