refactor(feed): extract read-model to app.feedquery + admin_user sweep
B-core-3 (2026-08-17 review): decouple two things from router modules. 1. Feed read-model → new app/feedquery.py: the pure query-building and row-serialization layer (feed_columns, serialize, _filtered_query, to_tsquery_str, and the keyset-pagination helpers) moves out of routes/feed.py, which keeps only the route handlers, _feed_params, and the request models. The three external consumers (playlists, search, plex/browse) now import from app.feedquery instead of reaching into the feed router. 2. admin_user sweep: 7 modules imported admin_user via app.routes.admin (an incidental re-export of app.auth.admin_user). Repoint them all to the definition in app.auth (audit, channels, config, quota, scheduler, plex/admin, plex/browse); routes.admin keeps its own import for its use. Pure code motion — no behaviour change. Full DB-lane suite 287 passed / 2 skipped; ruff clean.
This commit is contained in:
@@ -9,8 +9,8 @@ from sqlalchemy.orm import Session, aliased
|
||||
from app import quota
|
||||
from app.auth import current_user, has_read_scope, has_write_scope, require_write_scope
|
||||
from app.db import get_db
|
||||
from app.feedquery import feed_columns, serialize
|
||||
from app.models import Channel, Playlist, PlaylistItem, User, Video, VideoState
|
||||
from app.routes.feed import serialize, feed_columns
|
||||
from app.sync.playlists import (
|
||||
plan_push,
|
||||
push_playlist,
|
||||
|
||||
Reference in New Issue
Block a user