Commit 627a9394 authored by Andre Julius's avatar Andre Julius 👀
Browse files

Remove unused imports. Index refresh does not happen at script startup anymore,

but at each / or /index request. Return queue_size on successfull enque
parent 514a3935
......@@ -2,9 +2,7 @@ import logging
from api.player import player
from web import web
from api.index import reload_index
reload_index()
logging.basicConfig(
level=logging.DEBUG,
......
from flask import redirect, abort, request, jsonify, Response
from flask import redirect, abort, request, jsonify, Response, make_response
from web import web
import api.index
import api.player
......@@ -20,6 +20,7 @@ def catch_all(path):
@web.route("/")
@web.route("/index/")
def index():
api.index.reload_index()
return jsonify(api.index.index)
......@@ -31,6 +32,6 @@ def play(file):
logger.info(api.queue.q.qsize())
except Full:
return abort(403)
return Response(200)
return jsonify({"queue_size": api.queue.q.qsize()})
else:
return abort(404)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment