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

Experimental support for third party GNUFM scrobblers

This commit is contained in:
Krateng
2019-05-12 11:46:25 +02:00
parent 3fce682c00
commit 144c11c5c6
3 changed files with 114 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ from cleanup import *
from utilities import *
from malojatime import *
from urihandler import uri_to_internal
import compliant_api
# doreah toolkit
from doreah.logging import log
from doreah import tsv
@@ -73,6 +74,8 @@ def loadAPIkeys():
def checkAPIkey(k):
return (k in [k for [k,d] in clients])
def allAPIkeys():
return [k for [k,d] in clients]
####
@@ -610,6 +613,24 @@ def post_scrobble():
return ""
# standard-compliant scrobbling methods
@dbserver.post("/s/<path:path>")
def sapi(path):
path = path.split("/")
keys = FormsDict.decode(request.forms)
return compliant_api.handle(path,keys)
@dbserver.get("/s/<path:path>")
def sapi(path):
path = path.split("/")
keys = FormsDict.decode(request.query)
return compliant_api.handle(path,keys)
@dbserver.route("/sync")
def abouttoshutdown():
sync()