From b2dfe3569855f491c0cf85ddad18efca45613371 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 14 May 2025 21:54:36 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/iSponsorBlockTV/ytlounge.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/iSponsorBlockTV/ytlounge.py b/src/iSponsorBlockTV/ytlounge.py index 0244039..c852855 100644 --- a/src/iSponsorBlockTV/ytlounge.py +++ b/src/iSponsorBlockTV/ytlounge.py @@ -53,13 +53,13 @@ class YtLoungeApi(pyytlounge.YtLoungeApi): await asyncio.sleep(10) current_time = asyncio.get_event_loop().time() time_since_last_event = current_time - self.last_event_time - + # YouTube sends a message at least every 30 seconds if time_since_last_event > 60: self.logger.debug( f"Watchdog triggered: No events for {time_since_last_event:.1f} seconds" ) - + # Cancel current subscription if self.subscribe_task and not self.subscribe_task.done(): self.subscribe_task.cancel() @@ -74,7 +74,7 @@ class YtLoungeApi(pyytlounge.YtLoungeApi): # Subscribe to the lounge and start the watchdog async def subscribe_monitored(self, callback): self.callback = callback - + # Stop existing watchdog if running if self.subscribe_task_watchdog and not self.subscribe_task_watchdog.done(): self.watchdog_running = False