Adding a LinkDB model to store different links per show

This commit is contained in:
edipretoro 2026-01-02 15:08:47 +01:00
parent 8adc0623bd
commit 4bff05bc92

View File

@ -73,6 +73,27 @@ class TvShowDB(Base):
onupdate=func.datetime('now'),
nullable=False
)
class LinkDB(Base):
"""Modèle pour le stockage des liens de téléchargement (SQLAlchemy 2.0)."""
__tablename__: str = "links"
id: Mapped[int] = mapped_column(
Integer,
primary_key=True,
autoincrement=True
)
link: Mapped[str] = mapped_column(
String(255),
nullable=False
)
is_downloaded: Mapped[bool] = mapped_column(
Boolean,
default=False
)
show_id: Mapped[int] = mapped_column(ForeignKey("tvshows.id"))
show: Mapped["TvShowDB"] = relationship(back_populates="links")
class TvShowItem(scrapy.Item):
post_id: scrapy.Field = scrapy.Field()