Problem
Preparation storage accounting reserves the complete remote source size even when production streams that source through pipes and bounded memory buffers. A large Plex item can therefore be rejected for insufficient disk despite the real staging, artifact, and transient cache working set fitting comfortably.
Affected code:
cmd/movienightd/storage.go (preparation reservation calculation)
internal/sourcestream/source.go (streaming implementation and bounded buffers)
- source/mediaflow storage-estimate interfaces
Why this is deferred
This appears only near configured capacity limits or with very large media, but it creates avoidable false rejections and makes capacity settings misleading.
Proposed scope
- Let each source implementation report its actual cache/disk estimate rather than treating every source as a full local snapshot.
- Continue reserving full bytes for implementations that materialize the source locally.
- For streamed Plex sources, reserve only the bounded on-disk source cache (if any), staging output, artifacts, and documented filesystem headroom; keep in-memory pipe/range buffers out of disk accounting.
- Preserve overflow checks, free-space floor enforcement, concurrent reservation isolation, and fail-closed behavior when an estimate is unknown.
Acceptance criteria
- A streamed large source is accepted when its real disk working set fits, even if the remote media size exceeds free disk.
- A local/materialized source still reserves its full snapshot size.
- Concurrent preparations cannot overcommit capacity.
- Estimate overflow, unknown source type, and insufficient staging/artifact capacity still fail safely.
- Tests distinguish streamed and materialized sources with the same advertised media size.
Problem
Preparation storage accounting reserves the complete remote source size even when production streams that source through pipes and bounded memory buffers. A large Plex item can therefore be rejected for insufficient disk despite the real staging, artifact, and transient cache working set fitting comfortably.
Affected code:
cmd/movienightd/storage.go(preparation reservation calculation)internal/sourcestream/source.go(streaming implementation and bounded buffers)Why this is deferred
This appears only near configured capacity limits or with very large media, but it creates avoidable false rejections and makes capacity settings misleading.
Proposed scope
Acceptance criteria