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
......@@ -14,4 +12,4 @@ logging.basicConfig(
player.start(), host="", port=80)
\ No newline at end of file, host="", port=80)
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):
def index():
return jsonify(api.index.index)
......@@ -31,6 +32,6 @@ def play(file):
except Full:
return abort(403)
return Response(200)
return jsonify({"queue_size": api.queue.q.qsize()})
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