From 3c4849551bc9e32a9ef502cb3090dab199c1ac15 Mon Sep 17 00:00:00 2001 From: tcely Date: Fri, 7 Feb 2025 03:50:48 -0500 Subject: [PATCH] Define then update `*_hook` dictionaries --- tubesync/sync/hooks.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tubesync/sync/hooks.py b/tubesync/sync/hooks.py index c669a3b9..27133b49 100644 --- a/tubesync/sync/hooks.py +++ b/tubesync/sync/hooks.py @@ -5,6 +5,14 @@ from common.logger import log from django.conf import settings +progress_hook = { + 'status': dict(), +} + +postprocessor_hook = { + 'status': dict(), +} + class BaseStatus: valid = set() @@ -158,15 +166,13 @@ def yt_dlp_postprocessor_hook(event): status.cleanup() -progress_hook = { +progress_hook.update({ 'class': ProgressHookStatus(), 'function': yt_dlp_progress_hook, - 'status': dict(), -} +}) -postprocessor_hook = { +postprocessor_hook.update({ 'class': PPHookStatus(), 'function': yt_dlp_postprocessor_hook, - 'status': dict(), -} +})