R12 S1 step B. The 2011-line routes/plex.py becomes an app/routes/plex/
package:
- admin.py — connection test, catalog sync, owner watch-link config (5)
- browse.py — libraries, facets, collections, playlists, show/item, people (23)
- playback.py — image/subtitle proxies, HLS streaming, watch-state writes (10)
- _shared.py — the two genuinely cross-module helpers (_item_or_404, log)
- __init__.py — assembles `router` from the three sub-routers; the app wiring
(plex_routes.router in main.py) is unchanged.
Mechanically generated and proven behaviour-equivalent: every function/class
source relocated verbatim (get_source_segment equality) and the (method, path)
route set is identical to before. Endpoints keep the /api/plex prefix on each
sub-router. No SQL change (db.query untouched; 2.0 select() is the next step).
Gate: ruff clean, pytest 193 passed (pure-logic + DB lane).
14 lines
455 B
Python
14 lines
455 B
Python
"""Plex route package — assembles the admin/browse/playback sub-routers.
|
|
|
|
Split out of the former single routes/plex.py (R12 S1). `router` keeps the same shape the app
|
|
wiring expects (`plex_routes.router`), so main.py is unchanged.
|
|
"""
|
|
from fastapi import APIRouter
|
|
|
|
from app.routes.plex import admin, browse, playback
|
|
|
|
router = APIRouter()
|
|
router.include_router(admin.router)
|
|
router.include_router(browse.router)
|
|
router.include_router(playback.router)
|