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 + app/ytdl.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app') 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': '{}', diff --git a/app/ytdl.py b/app/ytdl.py index c91e4fc..c77347e 100644 --- a/app/ytdl.py +++ b/app/ytdl.py @@ -184,8 +184,8 @@ class DownloadQueue: def __init__(self, config, notifier): self.config = config self.notifier = notifier - self.queue = PersistentQueue('/queue/queue') - self.done = PersistentQueue('/queue/done', True) + self.queue = PersistentQueue(self.config.STATE_DIR + '/queue') + self.done = PersistentQueue(self.config.STATE_DIR + '/completed', True) self.initialized = False self.imported = False -- cgit