Files
KiraTV/backend/models/provider.py
T
joaquin f5d6745ed0 Initial commit: KiraTV IPTV proxy server
Full-stack IPTV management system with Xtream Codes API compatibility,
multi-account provider fan-out, Jellyfin local library integration,
real-time dashboard, EPG support, and A/V-sync-safe stream recovery.
2026-05-17 23:22:05 +02:00

25 lines
1.2 KiB
Python

from sqlalchemy import Column, Integer, String, Boolean, DateTime, Text, func
from sqlalchemy.orm import relationship
from ..database import Base
class ProviderAccount(Base):
__tablename__ = "provider_accounts"
id = Column(Integer, primary_key=True, index=True)
name = Column(String(100), nullable=False)
base_url = Column(String(500), nullable=False)
username = Column(String(200), nullable=False)
password = Column(String(200), nullable=False)
max_connections = Column(Integer, default=1, nullable=False)
is_active = Column(Boolean, default=True, nullable=False)
last_sync_at = Column(DateTime(timezone=True), nullable=True)
expiry_date = Column(DateTime(timezone=True), nullable=True)
# 0 = disabled; 6/12/24 = sync every N hours automatically
auto_sync_hours = Column(Integer, default=0, nullable=False)
# JSON: {"live": ["cat_id", ...], "movie": [...], "series": [...]}
last_sync_categories = Column(Text, nullable=True)
created_at = Column(DateTime(timezone=True), server_default=func.now())
channel_maps = relationship("ChannelProviderMap", back_populates="provider_account", cascade="all, delete-orphan")