Skip to main content

expected_download_bytes

Function expected_download_bytes 

Source
pub fn expected_download_bytes(
    quality: &str,
    runtime_ticks: Option<i64>,
    source_size: Option<i64>,
) -> Option<u64>
Expand description

The size a download for quality is expected to produce, in bytes.

  • A preset re-encodes both streams at fixed rates, so the size is rate × runtime. Jellyfin encodes to a target bitrate (-b:v with -maxrate), so the average lands near the cap rather than well under it.
  • original copies the picture and at most re-encodes the audio, so the output is the source’s size give or take the audio track — and when no transcode is needed at all it is exactly the source’s size.

None when the inputs needed are missing; the caller then has no total and the bar is indeterminate, which is honest and was the status quo.

TRACES: UR-071 | DR-290 | UT-252