Fixed code style

This commit is contained in:
ArabCoders 2023-11-03 15:23:02 +03:00
parent fead1f99c7
commit caca271e19

View file

@ -133,16 +133,13 @@ async def delete(request):
return web.Response(text=serializer.encode(status)) return web.Response(text=serializer.encode(status))
@routes.get(config.URL_PREFIX + 'history') @routes.get(config.URL_PREFIX + 'history')
async def list_queue(_): async def history(request):
history = []; history = { 'done': [], 'queue': []}
for _ ,v in dqueue.queue.saved_items(): for _ ,v in dqueue.queue.saved_items():
obj = vars(v) history['queue'].append(vars(v))
obj['list_type'] = 'queue'
history.append(obj)
for _ ,v in dqueue.done.saved_items(): for _ ,v in dqueue.done.saved_items():
obj = vars(v) history['done'].append(vars(v))
obj['list_type'] = 'done'
history.append(obj)
return web.Response(text=json.dumps(history)) return web.Response(text=json.dumps(history))