Always have Public channel available

This commit is contained in:
Jack Kingsman
2026-01-13 12:06:38 -08:00
parent 760bd0f7d6
commit 3ea98e309c
2 changed files with 11 additions and 5 deletions
+3
View File
@@ -7,6 +7,7 @@ from pydantic import BaseModel, Field
from app.dependencies import require_connected
from app.models import Channel
from app.radio_sync import ensure_default_channels
from app.repository import ChannelRepository
logger = logging.getLogger(__name__)
@@ -24,6 +25,8 @@ class CreateChannelRequest(BaseModel):
@router.get("", response_model=list[Channel])
async def list_channels() -> list[Channel]:
"""List all channels from the database."""
# Ensure Public channel always exists (self-healing)
await ensure_default_channels()
return await ChannelRepository.get_all()