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

Fixed GET scrobbling

This commit is contained in:
Krateng 2020-09-25 17:06:45 +02:00
parent c312608f2d
commit 22172d8b57
No known key found for this signature in database
GPG Key ID: 46735607861C6FCE
3 changed files with 11 additions and 4 deletions

View File

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

View File

@ -195,9 +195,16 @@ def compare_external(**keys):
@api.get("newscrobble") @api.get("newscrobble")
def get_post_scrobble(*args,**kwargs): def get_post_scrobble(artist:Multi,**keys):
"""DEPRECATED. Use the equivalent POST method instead.""" """DEPRECATED. Use the equivalent POST method instead."""
return post_scrobble(*args,**kwargs) artists = artist
title = keys.get("title")
album = keys.get("album")
duration = keys.get("seconds")
time = keys.get("time")
if time is not None: time = int(time)
return incoming_scrobble(artists,title,album=album,duration=duration,time=time)
@api.post("newscrobble") @api.post("newscrobble")
@authenticated_api_with_alternate(api_key_correct) @authenticated_api_with_alternate(api_key_correct)

View File

@ -7,7 +7,7 @@
<script src="/rangeselect.js"></script> <script src="/rangeselect.js"></script>
<script> <script>
function scrobble(encodedtrack) { function scrobble(encodedtrack) {
neo.xhttprequest('/api/newscrobble?' + encodedtrack).then(response=>{window.location.reload()}); neo.xhttprequest('/apis/mlj_1/newscrobble?' + encodedtrack,method="POST").then(response=>{window.location.reload()});
} }
</script> </script>
{% endblock %} {% endblock %}