aboutsummaryrefslogtreecommitdiff
path: root/app/main.py
diff options
context:
space:
mode:
authorAlex <alexta69@gmail.com>2022-01-26 00:01:16 +0200
committerGitHub <noreply@github.com>2022-01-26 00:01:16 +0200
commit1b2831871b20719c821a0bf16bfa09ce3efa8df9 (patch)
tree4373c1d048d402b72208cde9485fc5d2d08fba2e /app/main.py
parentupgraded yt-dlp (diff)
parentMerge branch 'master' of https://github.com/alexta69/metube into queuePersist... (diff)
downloadmetube-1b2831871b20719c821a0bf16bfa09ce3efa8df9.tar.gz
metube-1b2831871b20719c821a0bf16bfa09ce3efa8df9.tar.bz2
metube-1b2831871b20719c821a0bf16bfa09ce3efa8df9.zip
Merge pull request #106 from Erazor2/queuePersistence
Queue persistence
Diffstat (limited to 'app/main.py')
-rw-r--r--app/main.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/main.py b/app/main.py
index 8b2a57f..36c0e94 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': '{}',
@@ -68,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):
bgstack15