Fix adPlaying logic

This commit is contained in:
dmunozv04
2025-05-11 01:37:28 +02:00
parent a67e3eb860
commit a6dacc1d84

View File

@@ -56,7 +56,9 @@ class YtLoungeApi(pyytlounge.YtLoungeApi):
# 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")
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():
@@ -147,7 +149,8 @@ class YtLoungeApi(pyytlounge.YtLoungeApi):
if vid_id := data["contentVideoId"]:
self.logger.info(f"Getting segments for next video: {vid_id}")
create_task(self.api_helper.get_segments(vid_id))
elif (
if (
self.skip_ads and data["isSkipEnabled"] == "true"
): # YouTube uses strings for booleans
self.logger.info("Ad can be skipped, skipping")