reworked persistent queues

This commit is contained in:
Alex Shnitman 2022-01-25 23:56:17 +02:00
parent 9994777974
commit 80c2ed3f98
6 changed files with 1794 additions and 1833 deletions

View file

@ -69,6 +69,7 @@ class Notifier(DownloadQueueNotifier):
await sio.emit('cleared', serializer.encode(id))
dqueue = DownloadQueue(config, Notifier())
app.on_startup.append(lambda app: dqueue.initialize())
@routes.post(config.URL_PREFIX + 'add')
async def add(request):
@ -93,7 +94,6 @@ async def delete(request):
@sio.event
async def connect(sid, environ):
await dqueue.importQueue()
await sio.emit('all', serializer.encode(dqueue.get()), to=sid)
@routes.get(config.URL_PREFIX)