fix(capture): every process registers every table before its first query

The models now live in their units' packages, and a core model names a unit's by
string (User.subscriptions -> Subscription). The download child imports neither
catalog nor app.tables before db.get, so mapper configuration failed and every
download, clip, edit and upload job died with child_exit. Each entry point now
imports app.tables, and a test imports each one in a clean interpreter.
This commit is contained in:
2026-10-20 00:45:20 +02:00
parent 5ce292cd28
commit d73cdcee97
5 changed files with 67 additions and 0 deletions
+1
View File
@@ -24,6 +24,7 @@ sys.path.insert(0, "/app")
from sqlalchemy import delete, func, select
from app.db import SessionLocal
import app.tables # noqa: F401 — every table, before the first query
from app.catalog.models import Channel, Subscription, Video
from app.models import AppState, User
from app.reader.models import Playlist, PlaylistItem, VideoState