Cleanup only, no behaviour change (ruff clean + pytest 193): - imports hoisted above `router =` and grouped/sorted (isort) across the split files; ruff-format pass restores the 2-blank-line PEP8 spacing the generator collapsed to 1. - the shared on-disk cache root moves to a neutral app/plex/cache.py, so subtitles.py no longer imports it from imgcache.py (drops the cross-import). - the former plex.py module docstring's access-model note (read endpoints open to any authed user; admin endpoints test/sync) is restored in the package __init__.py.
14 lines
532 B
Python
14 lines
532 B
Python
"""Shared on-disk cache root for proxied Plex assets.
|
|
|
|
Both poster/art images (imgcache.py) and converted subtitle VTTs (subtitles.py) are cached here, so
|
|
the directory belongs to neither module — it lives in this neutral home to avoid a cross-import.
|
|
On-demand + bounded by the library size; no eviction (a few hundred MB at most for a big library —
|
|
acceptable, matching the download disk trade-offs).
|
|
"""
|
|
|
|
from pathlib import Path
|
|
|
|
from app.config import settings
|
|
|
|
CACHE_DIR = Path(settings.download_root) / ".plex-img-cache"
|