1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Listenbrainz API now nods and smiles on 'playing_now' requests

This commit is contained in:
Krateng
2020-09-05 16:59:25 +02:00
parent 09d3f10383
commit 9fb352cc6f
3 changed files with 11 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ author = {
"email":"maloja@krateng.dev",
"github": "krateng"
}
version = 2,9,5
version = 2,9,6
versionstr = ".".join(str(n) for n in version)
links = {
"pypi":"malojaserver",

View File

@@ -49,11 +49,16 @@ class Listenbrainz(APIHandler):
timestamp = int(listen["listened_at"])
except:
timestamp = None
elif listentype == "playing_now":
pass
except:
raise MalformedJSONException()
self.scrobble(artiststr,titlestr,timestamp)
return 200,{"status":"ok"}
if listentype == "playing_now": return 200,{"status":"ok"}
else:
self.scrobble(artiststr,titlestr,timestamp)
return 200,{"status":"ok"}
def validate_token(self,pathnodes,keys):
try: