0547f55844
refactor(server): extract the media/file-serving routes into routers/media.py (R3) ( #869 )
...
Song audio (/audio/{f}), the local-audio-path resolver (/api/audio-local-path),
and raw sloppak-member serving (/api/sloppak/{f}/file/{rel}) — plus the shared
_resolve_sloppak_local_file helper — move to lib/routers/media.py. Bodies verbatim
except @app->@router and the cache/static path seams (AUDIO_CACHE_DIR->
appstate.audio_cache_dir, STATIC_DIR->appstate.static_dir, SLOPPAK_CACHE_DIR->
appstate.sloppak_cache_dir — all already in the seam). No new slots.
The two test fixtures that redirect STATIC_DIR to a temp dir now also patch
appstate.static_dir (the moved routes read the seam, not server's global).
server.py: 2,638 -> 2,507 (-131).
Verified: pyflakes clean; route set identical (143), all unique-path (no
catch-all, no shadowing); full pytest 2395 passed (the audio-local-path +
sloppak-file-traversal cases). eslint 0. Boot smoke: /audio, /api/sloppak/{}/file
serve 404 for unknown, 0 tracebacks.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-07-11 15:36:22 +02:00
..
2026-06-29 12:26:29 +02:00
2026-06-16 18:49:40 +01:00
2026-07-11 14:56:35 +02:00
2026-07-07 09:54:06 +02:00
2026-06-16 18:47:13 +02:00
2026-07-11 11:32:21 +02:00
2026-07-05 00:17:43 +02:00
2026-07-03 12:15:43 +02:00
2026-07-10 15:06:22 +02:00
2026-07-11 11:56:53 +02:00
2026-07-11 11:56:53 +02:00
2026-07-03 12:15:43 +02:00
2026-07-11 11:32:21 +02:00
2026-07-03 12:15:43 +02:00
2026-06-23 11:03:01 +02:00
2026-07-03 12:15:43 +02:00
2026-07-11 15:36:22 +02:00
2026-06-16 18:47:13 +02:00
2026-07-03 12:15:43 +02:00
2026-06-23 11:03:01 +02:00
2026-07-03 22:58:39 +02:00
2026-07-11 14:56:12 +02:00
2026-07-11 11:32:21 +02:00
2026-07-03 12:15:43 +02:00
2026-07-03 12:15:43 +02:00
2026-07-03 12:15:43 +02:00
2026-07-03 13:01:07 +02:00
2026-06-23 11:03:01 +02:00
2026-07-03 13:01:07 +02:00
2026-07-05 00:15:50 +02:00
2026-06-16 19:36:53 +01:00
2026-07-11 11:32:21 +02:00
2026-06-23 11:03:01 +02:00
2026-07-11 12:35:05 +02:00
2026-07-11 11:32:21 +02:00
2026-07-05 21:09:38 +02:00
2026-06-23 11:03:01 +02:00
2026-07-02 08:40:20 +02:00
2026-07-07 23:58:49 +02:00
2026-07-05 00:20:31 +02:00
2026-07-10 13:12:10 +02:00
2026-06-16 18:47:13 +02:00
2026-07-05 20:08:19 +02:00
2026-07-03 12:15:43 +02:00
2026-06-16 18:47:13 +02:00
2026-07-10 21:12:54 +02:00
2026-07-10 21:12:54 +02:00
2026-07-10 21:12:54 +02:00
2026-07-07 23:57:20 +02:00
2026-07-03 12:15:43 +02:00
2026-07-03 12:15:43 +02:00
2026-06-16 18:47:13 +02:00
2026-06-23 11:03:01 +02:00
2026-07-10 19:16:01 +02:00
2026-07-03 12:15:43 +02:00
2026-06-16 19:36:53 +01:00
2026-06-16 19:36:53 +01:00
2026-07-11 11:32:21 +02:00
2026-07-05 01:11:38 +02:00
2026-07-07 23:58:49 +02:00
2026-07-07 10:27:45 +02:00
2026-07-07 10:27:17 +02:00
2026-07-03 12:15:43 +02:00
2026-06-16 18:47:13 +02:00
2026-07-02 08:40:20 +02:00
2026-06-16 18:47:13 +02:00
2026-07-10 17:16:34 +02:00
2026-06-23 11:03:01 +02:00
2026-07-10 20:16:22 +02:00
2026-07-10 19:58:09 +02:00
2026-06-23 11:03:01 +02:00
2026-07-03 14:45:30 +02:00
2026-07-08 10:14:40 +02:00
2026-06-25 00:02:16 +02:00
2026-07-03 12:15:43 +02:00
2026-07-03 12:15:43 +02:00
2026-06-16 18:47:13 +02:00
2026-07-03 12:15:43 +02:00
2026-06-16 19:36:53 +01:00
2026-06-16 18:47:13 +02:00
2026-07-11 11:32:21 +02:00
2026-07-11 12:35:05 +02:00
2026-07-11 12:35:05 +02:00
2026-07-11 12:35:05 +02:00
2026-07-05 00:16:42 +02:00
2026-06-16 18:47:13 +02:00
2026-07-03 12:15:43 +02:00
2026-06-16 18:47:13 +02:00
2026-06-20 21:59:04 +02:00
2026-07-11 15:36:22 +02:00
2026-06-20 14:10:04 -07:00
2026-06-20 21:23:48 +02:00
2026-06-16 18:47:13 +02:00
2026-06-23 18:05:45 +02:00
2026-06-20 21:35:07 +02:00
2026-06-16 18:47:13 +02:00
2026-07-03 12:15:43 +02:00
2026-07-03 12:15:43 +02:00
2026-06-23 11:03:01 +02:00
2026-07-02 20:51:57 +02:00
2026-07-03 12:15:43 +02:00
2026-07-03 12:15:43 +02:00
2026-06-23 11:03:01 +02:00
2026-06-16 18:47:13 +02:00
2026-07-10 13:05:39 +02:00
2026-07-03 12:15:43 +02:00
2026-06-16 18:47:13 +02:00
2026-07-03 12:15:43 +02:00
2026-07-03 12:15:43 +02:00
2026-07-03 12:15:43 +02:00
2026-07-10 21:30:53 +02:00
2026-06-16 18:47:13 +02:00