From 2e67a57bc92bfe4b673d1e4cf2cdea705ccbe2c6 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Mon, 1 Sep 2025 14:33:46 -0700 Subject: [PATCH] [BACKEND] Make resolution print debug-level (#1326) ``` Resolution assert is enabled, will fail on low-quality video downloads and presume throttle. Disable using the override variable `enable_resolution_assert: False ``` Spams during the initialization phase. Ideally, we should only print this once the subscription has begun downloading. Perhaps via a `print` plugin? Either way, set this to debug log level. --- .../prebuilt_presets/helpers/throttle_protection.yaml | 3 ++- tests/integration/plugins/test_throttle_protection.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ytdl_sub/prebuilt_presets/helpers/throttle_protection.yaml b/src/ytdl_sub/prebuilt_presets/helpers/throttle_protection.yaml index effca714..2f3afee3 100644 --- a/src/ytdl_sub/prebuilt_presets/helpers/throttle_protection.yaml +++ b/src/ytdl_sub/prebuilt_presets/helpers/throttle_protection.yaml @@ -43,7 +43,8 @@ presets: "Resolution assert is enabled, will fail on low-quality video downloads and presume throttle. Disable using the override variable `enable_resolution_assert: False`", "Resolution assert is disabled. Use at your own risk!" ), - enable_resolution_assert + enable_resolution_assert, + -1 ) } resolution_readable: "{width}x{height}" diff --git a/tests/integration/plugins/test_throttle_protection.py b/tests/integration/plugins/test_throttle_protection.py index d2275365..391ec299 100644 --- a/tests/integration/plugins/test_throttle_protection.py +++ b/tests/integration/plugins/test_throttle_protection.py @@ -205,7 +205,7 @@ class TestResolutionAssert: with assert_logs( logger=script_print_logger, expected_message="Resolution assert is disabled. Use at your own risk!", - log_level="info", + log_level="debug", expected_occurrences=1, ): _ = Subscription.from_dict( @@ -237,7 +237,7 @@ class TestResolutionAssert: "Resolution assert is enabled, will fail on low-quality video downloads and presume throttle. " "Disable using the override variable `enable_resolution_assert: False`" ), - log_level="info", + log_level="debug", expected_occurrences=1, ): subscription = Subscription.from_dict(