- Header shows a live sync status (total videos + channels still backfilling, or "paused"), polled every 30s - Admins can pause/resume the background sync; a paused flag in app_state makes scheduled jobs skip (migration 0006) - GET /api/feed/count returns the number of videos matching the current filters; shared filter builder keeps it in sync with /api/feed; shown above the feed - /api/sync/status reports backfill progress, pending enrichment and paused state
28 lines
759 B
Python
28 lines
759 B
Python
"""app_state (admin-controlled global flags)
|
|
|
|
Revision ID: 0006_app_state
|
|
Revises: 0005_shorts_probed
|
|
Create Date: 2026-06-11
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
revision: str = "0006_app_state"
|
|
down_revision: Union[str, None] = "0005_shorts_probed"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
"app_state",
|
|
sa.Column("id", sa.Integer(), primary_key=True),
|
|
sa.Column("sync_paused", sa.Boolean(), nullable=False, server_default="false"),
|
|
)
|
|
op.execute("INSERT INTO app_state (id, sync_paused) VALUES (1, false)")
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_table("app_state")
|