chore(traceability): shift this branch's ids clear of master's

Master allocated DR-224 and UT-211 while this branch was in flight — the third
collision on this work. Everything here moves up by one: DR-224..236 become
DR-225..237, UT-211..213 become UT-212..214. UR-079, UR-080 and IR-033 were
still free and are unchanged.

Mechanical, and matched on each row's own text rather than on its number, so a
row cannot be shifted twice or the wrong one caught. Master's DR-224 (the
background-audio toggle) and UT-211 are untouched.
This commit is contained in:
2026-08-22 13:45:04 +02:00
parent 156b9e3684
commit fecd6022fe
30 changed files with 5309 additions and 5070 deletions
+21 -21
View File
@@ -12,7 +12,7 @@
//! decides *how to deliver it*** — is the point. A multi-variant playlist handed
//! to ExoPlayer is still ExoPlayer's to adapt over; Rust never paces bytes.
//!
//! TRACES: UR-079 | DR-224
//! TRACES: UR-079 | DR-225
use serde::{Deserialize, Serialize};
@@ -30,7 +30,7 @@ use crate::settings::StreamingQuality;
/// Tagged (`{"type":"hls"}`) rather than a bare string so the frontend matches a
/// discriminant instead of comparing text.
///
/// TRACES: UR-079 | DR-224
/// TRACES: UR-079 | DR-225
#[derive(specta::Type, Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "camelCase")]
pub enum Transport {
@@ -52,7 +52,7 @@ pub enum Transport {
/// lets the UI say "this is not costing the server anything" without inferring
/// it from a URL shape.
///
/// TRACES: UR-079 | DR-227
/// TRACES: UR-079 | DR-228
#[derive(specta::Type, Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "camelCase")]
pub enum PlaybackKind {
@@ -73,7 +73,7 @@ impl PlaybackKind {
/// that several seek/reload paths still branch on; this keeps the two from
/// drifting by making one derive from the other.
///
/// TRACES: UR-079 | DR-227
/// TRACES: UR-079 | DR-228
pub fn needs_transcoding(&self) -> bool {
matches!(self, PlaybackKind::Transcode)
}
@@ -85,7 +85,7 @@ impl PlaybackKind {
/// there is no *chosen* rendition in that case, only the file itself, and
/// reporting the ceiling that happened to be set would misdescribe it.
///
/// TRACES: UR-079 | DR-224, DR-225
/// TRACES: UR-079 | DR-225, DR-226
#[derive(specta::Type, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Rendition {
@@ -108,7 +108,7 @@ pub struct Rendition {
/// them indistinguishable from Original. `exceeds_source` is what lets the
/// frontend render that honestly without knowing anything about bitrates.
///
/// TRACES: UR-070, UR-079 | DR-226, DR-121
/// TRACES: UR-070, UR-079 | DR-227, DR-121
#[derive(specta::Type, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct QualityOption {
@@ -133,7 +133,7 @@ pub struct QualityOption {
///
/// Replaces the bare `String` URL that `get_video_stream_url` used to return.
///
/// TRACES: UR-079 | DR-224, DR-226, DR-227
/// TRACES: UR-079 | DR-225, DR-227, DR-228
#[derive(specta::Type, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct StreamSelection {
@@ -145,7 +145,7 @@ pub struct StreamSelection {
pub playback_kind: PlaybackKind,
/// The negotiated rendition; `None` when direct-playing the source as-is.
pub rendition: Option<Rendition>,
/// What this media source can offer, for the quality picker (DR-226).
/// What this media source can offer, for the quality picker (DR-227).
pub available: Vec<QualityOption>,
/// The media source this selection is for, so a later re-open (quality
/// change, audio-track switch, transcoded seek) targets the same one.
@@ -160,7 +160,7 @@ pub struct StreamSelection {
/// queue's long-standing `needs_transcoding` flag and the seek strategy both
/// read this, so there is one answer rather than three.
///
/// TRACES: UR-079 | DR-224, DR-227
/// TRACES: UR-079 | DR-225, DR-228
pub needs_transcoding: bool,
}
@@ -171,7 +171,7 @@ impl StreamSelection {
/// source's — and offering a quality ladder over it would be a lie, since
/// nothing about a local file can be re-negotiated.
///
/// TRACES: UR-071, UR-079 | DR-224
/// TRACES: UR-071, UR-079 | DR-225
pub fn local_file(url: impl Into<String>) -> Self {
Self {
url: url.into(),
@@ -199,7 +199,7 @@ impl StreamSelection {
/// all). In that case nothing can be judged redundant and every rung is offered,
/// which is the safe direction: the viewer keeps every choice they had before.
///
/// TRACES: UR-070, UR-079 | DR-226, DR-121 | UT-211
/// TRACES: UR-070, UR-079 | DR-227, DR-121 | UT-212
pub fn quality_options_for_source(source_bitrate: Option<u64>) -> Vec<QualityOption> {
StreamingQuality::ALL
.iter()
@@ -226,7 +226,7 @@ mod tests {
/// The tag the frontend matches on has to be exactly what it expects, and
/// it is a *string in TypeScript* — nothing but a test keeps the two in step.
///
/// TRACES: UR-079 | DR-224 | UT-211
/// TRACES: UR-079 | DR-225 | UT-212
#[test]
fn test_transport_serialises_with_the_tag_the_frontend_matches() {
let cases = [
@@ -242,7 +242,7 @@ mod tests {
}
}
/// TRACES: UR-079 | DR-227 | UT-211
/// TRACES: UR-079 | DR-228 | UT-212
#[test]
fn test_playback_kind_serialises_with_the_tag_the_frontend_matches() {
let cases = [
@@ -261,7 +261,7 @@ mod tests {
/// Only a transcode costs the server encoder time. A direct *stream* is a
/// remux — cheap, and not what `needs_transcoding` has ever meant.
///
/// TRACES: UR-079 | DR-227 | UT-211
/// TRACES: UR-079 | DR-228 | UT-212
#[test]
fn test_only_transcode_counts_as_transcoding() {
assert!(PlaybackKind::Transcode.needs_transcoding());
@@ -272,7 +272,7 @@ mod tests {
/// A local file is a direct play over a local transport, with no ladder:
/// nothing about a file on disk can be re-negotiated.
///
/// TRACES: UR-071, UR-079 | DR-224 | UT-211
/// TRACES: UR-071, UR-079 | DR-225 | UT-212
#[test]
fn test_local_file_selection_offers_no_ladder() {
let selection = StreamSelection::local_file("http://127.0.0.1:9000/media/x.mkv");
@@ -286,7 +286,7 @@ mod tests {
/// The camelCase rule applies to nested struct fields too, and
/// `playbackKind` is the one the frontend branches on.
///
/// TRACES: UR-079 | DR-224 | UT-211
/// TRACES: UR-079 | DR-225 | UT-212
#[test]
fn test_stream_selection_fields_are_camel_case_on_the_wire() {
let selection = StreamSelection {
@@ -321,7 +321,7 @@ mod tests {
/// The measured library has 1.1 Mbps sources in it. Offering those a choice
/// of 20, 10, 8, 4 and 2 Mbps is offering five ways to spell "Original".
///
/// TRACES: UR-070, UR-079 | DR-226, DR-121 | UT-211
/// TRACES: UR-070, UR-079 | DR-227, DR-121 | UT-212
#[test]
fn test_rungs_above_the_source_bitrate_are_marked_redundant() {
let options = quality_options_for_source(Some(1_122_137));
@@ -361,7 +361,7 @@ mod tests {
/// `Original` is the source, so it is never "above" it — not even for a
/// source whose bitrate is unknown or zero.
///
/// TRACES: UR-070, UR-079 | DR-226 | UT-211
/// TRACES: UR-070, UR-079 | DR-227 | UT-212
#[test]
fn test_original_is_never_marked_as_exceeding_the_source() {
for bitrate in [None, Some(0), Some(1), Some(50_000_000)] {
@@ -377,7 +377,7 @@ mod tests {
/// An `avi` with no reported bitrate must not lose the picker. Judging
/// nothing redundant is the safe direction — the viewer keeps every choice.
///
/// TRACES: UR-070, UR-079 | DR-226 | UT-211
/// TRACES: UR-070, UR-079 | DR-227 | UT-212
#[test]
fn test_an_unknown_source_bitrate_keeps_every_rung_offered() {
let options = quality_options_for_source(None);
@@ -391,7 +391,7 @@ mod tests {
/// A 4K remux constrains at every rung — the ladder is fully meaningful.
///
/// TRACES: UR-070, UR-079 | DR-226 | UT-211
/// TRACES: UR-070, UR-079 | DR-227 | UT-212
#[test]
fn test_a_source_above_the_ladder_marks_nothing_redundant() {
let options = quality_options_for_source(Some(40_000_000));
@@ -401,7 +401,7 @@ mod tests {
/// The picker's text comes from Rust, beside the numbers it describes, so a
/// relabelled rung cannot drift out of step with what it does.
///
/// TRACES: UR-070, UR-079 | DR-226 | UT-211
/// TRACES: UR-070, UR-079 | DR-227 | UT-212
#[test]
fn test_options_carry_the_ladder_labels() {
let options = quality_options_for_source(Some(6_652_961));