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:
parent
c312608f2d
commit
22172d8b57
@ -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",
|
||||||
|
@ -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)
|
||||||
|
@ -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 %}
|
||||||
|
Loading…
Reference in New Issue
Block a user