From 2badc0e611d5a4a247900eef099c5b366f31957c Mon Sep 17 00:00:00 2001 From: Devin Collins Date: Fri, 18 Apr 2025 07:30:56 -0700 Subject: [PATCH] fix(ad-schedule): Return proper values when config isn't setup --- manifest.json | 2 +- twitch_backend.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 547353f..0909107 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "version": "1.5.0", + "version": "1.5.1", "thumbnail": "store/thumbnail.png", "id": "com_imdevinc_StreamControllerTwitchPlugin", "name": "Twitch Integration", diff --git a/twitch_backend.py b/twitch_backend.py index 7924562..a00bfd5 100644 --- a/twitch_backend.py +++ b/twitch_backend.py @@ -3,7 +3,7 @@ from urllib.parse import urlparse, parse_qs, urlencode import threading import requests -from datetime import datetime +from datetime import datetime, timedelta from loguru import logger as log from twitchpy.client import Client @@ -143,7 +143,7 @@ def play_ad(self, length: int) -> None: def get_next_ad(self) -> tuple[datetime, int]: if not self.twitch: - return "Not Live" + return datetime.now() - timedelta(minutes=1), -1 self.validate_auth() schedule = self.twitch.get_ad_schedule(self.user_id) return schedule.next_ad_at, schedule.snooze_count