Refactored OwncastSentry internals and API validation.
CI / Formatting (push) Failing after 7s
CI / Linting (push) Successful in 12s
CI / Tests (push) Successful in 47s
CI / Type Checking (push) Successful in 11s
CI / Spelling (push) Successful in 7s

This commit is contained in:
2026-05-17 14:46:44 -04:00
parent 179d087e33
commit 0620c675d9
25 changed files with 2730 additions and 1569 deletions
+9 -4
View File
@@ -23,12 +23,12 @@ from prometheus_client.exposition import choose_encoder
from .commands import CommandHandler
from .config import Config
from .database import StreamRepository, SubscriptionRepository
from .metrics import ErrorSource, MetricsService
from .migrations import get_upgrade_table
from .notification_service import NotificationService
from .owncast_client import OwncastClient
from .repository import StreamRepository, SubscriptionRepository, get_upgrade_table
from .stream_monitor import StreamMonitor
from .subscription_manager import SubscriptionManager
if TYPE_CHECKING:
from mautrix.util.async_db import Database, UpgradeTable
@@ -97,14 +97,19 @@ class OwncastSentry(Plugin):
metrics=self.metrics_service,
)
# Initialize command handler
self.command_handler = CommandHandler(
# Initialize subscription manager
self.subscription_manager = SubscriptionManager(
self.owncast_client,
self.stream_repo,
self.subscription_repo,
self.log,
)
# Initialize command handler
self.command_handler = CommandHandler(
self.subscription_manager,
)
# Schedule periodic stream state updates every 60 seconds
self.sched.run_periodically(60, self._update_all_stream_states)