feat: sync status indicator, admin pause/resume, filtered video count
- 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
This commit is contained in:
parent
f73cbdb490
commit
dc73b43b71
10 changed files with 298 additions and 69 deletions
28
backend/alembic/versions/0006_app_state.py
Normal file
28
backend/alembic/versions/0006_app_state.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"""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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue