Commit 07e650b8 authored by Andre Julius's avatar Andre Julius 👀
Browse files

Enque items based on http request. Return error codes when queue full

parent cc75c7b6
import logging
from api.player import player
from web import web
from api.index import reload_index
reload_index(), host="", port=80)
format='%(asctime)s %(levelname)-5s %(name)-18s %(message)s',
datefmt='%y-%m-%d %H:%M'
player.start(), host="", port=80)
\ No newline at end of file
......@@ -2,6 +2,11 @@ from flask import redirect, abort, request, jsonify, Response
from web import web
import api.index
import api.player
import api.queue
import logging
from queue import Full
logger = logging.getLogger("queue")
@web.route('/', defaults={'path': ''})
......@@ -21,7 +26,11 @@ def index():
def play(file):
if api.index.is_indexed(file):
api.queue.q.put(file, False)
except Full:
return abort(403)
return Response(200)
return abort(404)
return "done"
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