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:
21
database.py
21
database.py
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user