feat(stream): add Stream model for managing streaming service links to sounds; update Sound model to include relationship with Stream

This commit is contained in:
JSC
2025-07-05 18:31:47 +02:00
parent 024c58f013
commit fac4fdf212
3 changed files with 177 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ from app.database import db
if TYPE_CHECKING:
from app.models.playlist_sound import PlaylistSound
from app.models.stream import Stream
class SoundType(Enum):
@@ -96,6 +97,11 @@ class Sound(db.Model):
back_populates="sound",
cascade="all, delete-orphan",
)
streams: Mapped[list["Stream"]] = relationship(
"Stream",
back_populates="sound",
cascade="all, delete-orphan",
)
def __repr__(self) -> str:
"""String representation of Sound."""