Moved channel URLs to channels_urls table. Create CRUD endpoints for new table.
All checks were successful
AWS Deploy on Push / build (push) Successful in 1m8s
All checks were successful
AWS Deploy on Push / build (push) Successful in 1m8s
This commit is contained in:
@@ -3,22 +3,49 @@ from typing import List
|
||||
from uuid import UUID
|
||||
from pydantic import BaseModel
|
||||
|
||||
class ChannelURLCreate(BaseModel):
|
||||
"""Pydantic model for creating channel URLs"""
|
||||
url: str
|
||||
|
||||
class ChannelURLBase(ChannelURLCreate):
|
||||
"""Base Pydantic model for channel URL responses"""
|
||||
id: UUID
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
class ChannelURLResponse(ChannelURLBase):
|
||||
"""Pydantic model for channel URL responses"""
|
||||
pass
|
||||
|
||||
class ChannelCreate(BaseModel):
|
||||
"""Pydantic model for creating channels"""
|
||||
urls: List[str]
|
||||
urls: List[str] # List of URLs to create with the channel
|
||||
name: str
|
||||
group_title: str
|
||||
tvg_id: str
|
||||
tvg_logo: str
|
||||
tvg_name: str
|
||||
|
||||
class ChannelUpdate(ChannelCreate):
|
||||
class ChannelUpdate(BaseModel):
|
||||
"""Pydantic model for updating channels"""
|
||||
pass
|
||||
name: str | None = None
|
||||
group_title: str | None = None
|
||||
tvg_id: str | None = None
|
||||
tvg_logo: str | None = None
|
||||
tvg_name: str | None = None
|
||||
|
||||
class ChannelResponse(ChannelCreate):
|
||||
class ChannelResponse(BaseModel):
|
||||
"""Pydantic model for channel responses"""
|
||||
id: UUID
|
||||
name: str
|
||||
group_title: str
|
||||
tvg_id: str
|
||||
tvg_logo: str
|
||||
tvg_name: str
|
||||
urls: List[ChannelURLResponse] # List of URL objects without channel_id
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
Reference in New Issue
Block a user