From eb1f031b33d3df3c0d3351b0cb1b2b7078e30245 Mon Sep 17 00:00:00 2001 From: Erazor2 Date: Sat, 15 Jan 2022 12:17:12 +0000 Subject: Queue persistence for download and completed --- app/main.py | 1 + 1 file changed, 1 insertion(+) (limited to 'app/main.py') diff --git a/app/main.py b/app/main.py index 8b2a57f..f901afc 100644 --- a/app/main.py +++ b/app/main.py @@ -92,6 +92,7 @@ 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) -- cgit From 1ebf1da076a993be60734d7019ae9a8d98b8c97a Mon Sep 17 00:00:00 2001 From: Erazor2 Date: Mon, 17 Jan 2022 18:47:32 +0000 Subject: Added Env-Var for State-Directory --- app/main.py | 1 + 1 file changed, 1 insertion(+) (limited to 'app/main.py') diff --git a/app/main.py b/app/main.py index f901afc..5d59958 100644 --- a/app/main.py +++ b/app/main.py @@ -16,6 +16,7 @@ class Config: _DEFAULTS = { 'DOWNLOAD_DIR': '.', 'AUDIO_DOWNLOAD_DIR': '%%DOWNLOAD_DIR', + 'STATE_DIR': '.', 'URL_PREFIX': '', 'OUTPUT_TEMPLATE': '%(title)s.%(ext)s', 'YTDL_OPTIONS': '{}', -- cgit From 80c2ed3f98b5b3d2269cf58089487b8c7262953d Mon Sep 17 00:00:00 2001 From: Alex Shnitman Date: Tue, 25 Jan 2022 23:56:17 +0200 Subject: reworked persistent queues --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/main.py') diff --git a/app/main.py b/app/main.py index 5d59958..36c0e94 100644 --- a/app/main.py +++ b/app/main.py @@ -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) -- cgit