feat: flat design Sunset Glitch + download manager + settings + recommendations overhaul
- Sunset Glitch color palette applied to all templates - Font Awesome icons throughout UI - Download manager with parallel queue and progress tracking - Settings page with dynamic configuration - Recommendations router enhanced with scoring - Local vendor libs (Alpine.js, HTMX) for offline support - Auto test suite with screenshots - Series releases list component - New download model
This commit is contained in:
@@ -70,3 +70,4 @@ from .watchlist import WatchlistItemTable, WatchlistSettingsTable
|
||||
from .favorites import FavoriteTable
|
||||
from .sonarr import SonarrMappingTable, SonarrConfigTable
|
||||
from .settings import AppSettingsTable
|
||||
from .download import DownloadTaskTable
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
"""Models for download task persistence with SQLModel support"""
|
||||
import uuid
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from sqlmodel import SQLModel, Field, Column, String
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class DownloadStatus(str, Enum):
|
||||
PENDING = "pending"
|
||||
DOWNLOADING = "downloading"
|
||||
PAUSED = "paused"
|
||||
COMPLETED = "completed"
|
||||
FAILED = "failed"
|
||||
CANCELLED = "cancelled"
|
||||
|
||||
|
||||
class DownloadTaskTable(SQLModel, table=True):
|
||||
"""Database table for persisting download tasks across server restarts."""
|
||||
__tablename__ = "download_tasks"
|
||||
|
||||
id: str = Field(
|
||||
default_factory=lambda: str(uuid.uuid4()),
|
||||
primary_key=True,
|
||||
index=True,
|
||||
nullable=False,
|
||||
)
|
||||
url: str = Field(default="", sa_column=Column(String))
|
||||
filename: str = Field(sa_column=Column(String))
|
||||
host: str = Field(default="other", sa_column=Column(String))
|
||||
status: str = Field(default="pending", sa_column=Column(String))
|
||||
progress: float = Field(default=0.0)
|
||||
downloaded_bytes: int = Field(default=0)
|
||||
total_bytes: Optional[int] = Field(default=None)
|
||||
speed: float = Field(default=0.0)
|
||||
error: Optional[str] = Field(default=None, sa_column=Column(String))
|
||||
created_at: datetime = Field(default_factory=datetime.now)
|
||||
started_at: Optional[datetime] = Field(default=None)
|
||||
completed_at: Optional[datetime] = Field(default=None)
|
||||
file_path: Optional[str] = Field(default=None, sa_column=Column(String))
|
||||
@@ -27,6 +27,13 @@ class AppSettingsBase(SQLModel):
|
||||
|
||||
# #12: Custom download directory
|
||||
download_dir: str = Field(default="downloads")
|
||||
|
||||
# #13: Content weight mode ("auto" = based on download habits, "manual" = user-defined)
|
||||
content_weight_mode: str = Field(default="auto", sa_column=Column(String))
|
||||
|
||||
# #14: Manual content weights (used when content_weight_mode = "manual")
|
||||
content_weight_anime: int = Field(default=2)
|
||||
content_weight_series: int = Field(default=1)
|
||||
|
||||
@property
|
||||
def disabled_providers(self) -> List[str]:
|
||||
@@ -64,6 +71,9 @@ class AppSettings(BaseModel):
|
||||
anime_enabled: bool = True
|
||||
series_enabled: bool = True
|
||||
download_dir: str = "downloads"
|
||||
content_weight_mode: str = "auto"
|
||||
content_weight_anime: int = 2
|
||||
content_weight_series: int = 1
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
@@ -79,3 +89,6 @@ class AppSettingsUpdate(BaseModel):
|
||||
anime_enabled: Optional[bool] = None
|
||||
series_enabled: Optional[bool] = None
|
||||
download_dir: Optional[str] = None
|
||||
content_weight_mode: Optional[str] = None
|
||||
content_weight_anime: Optional[int] = None
|
||||
content_weight_series: Optional[int] = None
|
||||
|
||||
Reference in New Issue
Block a user