Tackle remaining unscoped items: cookies chmod, log redact, Bandcamp, ETag+gzip
Four items knocked off the unscoped list: Auto-chmod 0600 cookies.txt - web::write_cookies now sets mode 0600 on the file after writing, on Unix. Mirrors the same guard we put on yt-offline.db. cookies.txt carries live session credentials; no reason for it to stay umask-default. Redact cookies path from job log - Downloader::spawn_job now runs each stdout/stderr line through a small redactor that replaces the absolute cookies.txt path with the bare filename before forwarding to the Job log. yt-dlp can echo the path in error strings, which leaks $HOME into the UI and /api/progress responses. - 2 new tests cover the strip + pass-through cases. Bandcamp full-discography mode - Bandcamp at the bare artist URL is already a Channel in our classifier and yt-dlp's BandcampUserIE returns the full discography. The output template for Bandcamp's channel case now organizes tracks into per-album subfolders via `%(album|Unknown)s` so a discography pull stays coherent instead of one flat directory. - New `Downloader::apply_platform_extras` adds `--embed-thumbnail` for audio-first platforms (Bandcamp, SoundCloud) so music players see the cover art via embedded tags rather than scanning for a sidecar JPEG. Library ETag + gzip - WebState gains `library_version: AtomicU64`. `bump_library_version()` is called from post_rescan, post_watched, post_maintenance_remove, and post_resume (only when crossing the "Continue watching" >3.0 boundary so playback-time updates don't constantly invalidate the cache). - get_library is now Response-returning; it consults `If-None-Match` and short-circuits with 304 Not Modified when the client's ETag matches. Otherwise it sends `ETag: "<n>"` alongside the JSON. - JS `loadLibrary()` caches the ETag and sends it on subsequent calls. Returns early on 304 keeping the existing in-memory library array. - Adds `tower_http::compression::CompressionLayer` (gzip). Already- compressed media served from ServeDir is auto-skipped by the layer; JSON responses get ~10× smaller. New `compression-gzip` feature on the tower-http dep. 46 unit tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b24ef4be67
commit
8d1c274075
3 changed files with 163 additions and 12 deletions
|
|
@ -16,7 +16,7 @@ axum = { version = "0.7", features = ["macros"] }
|
|||
tokio = { version = "1", features = ["full"] }
|
||||
tokio-util = { version = "0.7", features = ["io"] }
|
||||
tokio-stream = "0.1"
|
||||
tower-http = { version = "0.5", features = ["cors", "fs"] }
|
||||
tower-http = { version = "0.5", features = ["cors", "fs", "compression-gzip"] }
|
||||
argon2 = "0.5"
|
||||
rand = "0.8"
|
||||
# File-picker dialog for the desktop GUI. xdg-portal backend keeps it pure-Rust
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue