keep ffprobe as the floor under the meta.json lookup
the previous commit read the duration from meta.json instead of spawning ffprobe. correct for an indexed album and wrong everywhere else: /stream serves any home-relative path and never required an index, so a library that has not been indexed got no header at all. alpha is exactly that case — its music cache is empty — which is how this was caught rather than shipped. "always present" replaced with "present if indexed" is the same regression as removing the header, one layer down. so both, in order: meta.json when it can answer, ffprobe when it cannot, each cached. verified on an indexed album (247 from meta, 0.3ms warm) and on the same file with its index deleted (7.03 from ffprobe, 83ms cold, 0.1ms warm).
This commit is contained in:
+3
-1
@@ -43,7 +43,9 @@ Byte-range streaming so the player can **seek without downloading the whole file
|
||||
client and stays in the contract. New clients should still prefer `durationSec` from `/meta` — it
|
||||
arrives with the queue, before the first stream request.
|
||||
|
||||
Absent when the album has not been indexed, exactly as it was absent when ffprobe failed.
|
||||
`meta.json` is the fast path, not the only one: `/stream` serves any home-relative path and does not
|
||||
require indexing, so an unindexed album falls back to ffprobe (cached per file) rather than dropping
|
||||
the header. Absent only if ffprobe is missing or the file is unreadable — as before.
|
||||
- **`ETag`** is `mtime-size` in base36. A whole-file request with a matching `If-None-Match` answers
|
||||
`304`; a Range request never does, because a 304 would answer a question about part of a file with a
|
||||
statement about all of it.
|
||||
|
||||
Reference in New Issue
Block a user