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
+28 -28
View File
@@ -43,7 +43,7 @@ static STREAMING_QUALITY: RwLock<StreamingQuality> = RwLock::new(StreamingQualit
/// Cleared when a new item starts playing, so the override cannot outlive the
/// playback it was chosen for. The device default is never touched by it.
///
/// TRACES: UR-074, UR-079 | DR-225
/// TRACES: UR-074, UR-079 | DR-226
static PLAYBACK_QUALITY_OVERRIDE: RwLock<Option<StreamingQuality>> = RwLock::new(None);
/// Set the durable device default. Applies to every stream opened afterwards
@@ -71,7 +71,7 @@ pub fn streaming_quality() -> StreamingQuality {
/// Move *this playback* to a different ceiling without disturbing the default.
///
/// TRACES: UR-074, UR-079 | DR-225
/// TRACES: UR-074, UR-079 | DR-226
pub fn set_playback_quality_override(quality: StreamingQuality) {
*PLAYBACK_QUALITY_OVERRIDE.write_safe() = Some(quality);
}
@@ -82,14 +82,14 @@ pub fn set_playback_quality_override(quality: StreamingQuality) {
/// not silently govern the next one. Autoplaying the next episode is the case
/// that matters — nobody re-opens the picker between episodes.
///
/// TRACES: UR-074, UR-079 | DR-225
/// TRACES: UR-074, UR-079 | DR-226
pub fn clear_playback_quality_override() {
*PLAYBACK_QUALITY_OVERRIDE.write_safe() = None;
}
/// The per-playback override, if one is in force.
///
/// TRACES: UR-074, UR-079 | DR-225
/// TRACES: UR-074, UR-079 | DR-226
pub fn playback_quality_override() -> Option<StreamingQuality> {
*PLAYBACK_QUALITY_OVERRIDE.read_safe()
}
@@ -102,7 +102,7 @@ pub fn playback_quality_override() -> Option<StreamingQuality> {
/// the old static: a negotiation that authorises a direct play the URL builder
/// then constrains (or vice versa) leaks the cap.
///
/// TRACES: UR-074, UR-079 | DR-225
/// TRACES: UR-074, UR-079 | DR-226
pub fn effective_streaming_quality() -> StreamingQuality {
playback_quality_override().unwrap_or_else(streaming_quality)
}
@@ -627,7 +627,7 @@ impl OnlineRepository {
// On the webview path this still resolves to "h264" alone, so nothing
// changes there.
//
// TRACES: UR-004, UR-080 | DR-233
// TRACES: UR-004, UR-080 | DR-234
let (renderer_video_codecs, _) = super::device_profile::renderer_codecs();
let mut params = vec![
("api_key", self.access_token.clone()),
@@ -775,10 +775,10 @@ impl OnlineRepository {
///
/// The single place the device profile is built and POSTed. Both
/// [`get_playback_info`](Self::get_playback_info) (the legacy shape) and
/// `get_stream_selection` (the DR-224 contract) go through it, so the
/// `get_stream_selection` (the DR-225 contract) go through it, so the
/// profile they negotiate under cannot drift apart.
///
/// TRACES: UR-004, UR-074, UR-079 | DR-224, DR-227
/// TRACES: UR-004, UR-074, UR-079 | DR-225, DR-228
async fn negotiate_playback(
&self,
item_id: &str,
@@ -788,7 +788,7 @@ impl OnlineRepository {
// What the renderer that will decode this can play. One source, shared
// with the transcode URL builder and the client-side audio override, so
// the profile we advertise and the stream we then ask for cannot
// disagree. TRACES: UR-004, UR-080 | DR-233
// disagree. TRACES: UR-004, UR-080 | DR-234
let (video_codecs, audio_codecs) = super::device_profile::renderer_codecs();
// Video plays in a webview <video> element on every platform, which
@@ -870,7 +870,7 @@ impl OnlineRepository {
//
// Capped at the two codecs a Jellyfin server actually
// encodes, so a wider decode list never asks it for an av1
// encode. TRACES: UR-004, UR-080 | DR-233
// encode. TRACES: UR-004, UR-080 | DR-234
video_codec: Some(
if video_codecs.contains("hevc") {
"h264,hevc"
@@ -948,7 +948,7 @@ impl OnlineRepository {
/// frontend stops testing the URL for `.m3u8`, and the quality ladder for
/// *this* source so the picker stops offering rungs that mean nothing for it.
///
/// TRACES: UR-070, UR-079 | DR-224, DR-225, DR-226, DR-227 | UT-212
/// TRACES: UR-070, UR-079 | DR-225, DR-226, DR-227, DR-228 | UT-213
pub async fn get_stream_selection(
&self,
item_id: &str,
@@ -1512,7 +1512,7 @@ impl JellyfinItem {
// exactly how the cap used to leak (a negotiation authorising a direct play the
// URL builder then never got to constrain).
//
// TRACES: UR-079 | DR-224, DR-227
// TRACES: UR-079 | DR-225, DR-228
// ---------------------------------------------------------------------------
#[derive(Debug, Serialize)]
@@ -1605,7 +1605,7 @@ pub struct NegotiatedSource {
/// The source's own bitrate, when the server reports one.
///
/// Fills the quality picker's "this rung is the same as Original" judgement
/// (DR-226). Absent for some containers — the sampled library has `avi`
/// (DR-227). Absent for some containers — the sampled library has `avi`
/// files with no bitrate at all — in which case nothing is judged redundant
/// and every rung stays offered.
#[serde(default)]
@@ -1640,7 +1640,7 @@ pub struct NegotiatedStream {
/// separately, or that the viewer has pinned a track the file does not default
/// to.
///
/// TRACES: UR-079 | DR-227 | UT-212
/// TRACES: UR-079 | DR-228 | UT-213
pub fn decide_playback_kind(
source: &NegotiatedSource,
audio_forces_transcode: bool,
@@ -3157,7 +3157,7 @@ mod tests {
set_streaming_quality(StreamingQuality::Original);
// A leaked per-playback override would cap every later test's
// expectations without appearing anywhere in its setup.
// TRACES: UR-074, UR-079 | DR-225
// TRACES: UR-074, UR-079 | DR-226
clear_playback_quality_override();
}
}
@@ -4217,7 +4217,7 @@ mod tests {
}
// -----------------------------------------------------------------------
// Direct-play negotiation (DR-227)
// Direct-play negotiation (DR-228)
//
// Fixtures rather than a live server, but the *shapes* are real: every one
// below was observed in a `PlaybackInfo` response from the development
@@ -4242,11 +4242,11 @@ mod tests {
}
}
/// The whole point of DR-227: a source the server will serve untouched is
/// The whole point of DR-228: a source the server will serve untouched is
/// served untouched. Before this, every video play built an HLS transcode
/// URL regardless.
///
/// TRACES: UR-079 | DR-227 | UT-212
/// TRACES: UR-079 | DR-228 | UT-213
#[test]
fn test_a_supported_source_direct_plays() {
let source = source_fixture();
@@ -4259,7 +4259,7 @@ mod tests {
/// The server can remux without re-encoding. That is not a transcode and
/// must not be reported as one — the difference is a whole CPU core.
///
/// TRACES: UR-079 | DR-227 | UT-212
/// TRACES: UR-079 | DR-228 | UT-213
#[test]
fn test_a_remuxable_source_direct_streams() {
let source = NegotiatedSource {
@@ -4278,7 +4278,7 @@ mod tests {
/// An unsupported codec — the hevc that is ~80% of the sampled library,
/// under the Linux h264-only profile — transcodes.
///
/// TRACES: UR-079 | DR-227 | UT-212
/// TRACES: UR-079 | DR-228 | UT-213
#[test]
fn test_an_unsupported_source_transcodes() {
let source = NegotiatedSource {
@@ -4297,7 +4297,7 @@ mod tests {
/// track the webview cannot decode, which renders as picture with no sound.
/// The client's verdict has to win over the server's.
///
/// TRACES: UR-079 | DR-227, DR-148 | UT-212
/// TRACES: UR-079 | DR-228, DR-148 | UT-213
#[test]
fn test_undecodable_audio_overrides_the_servers_direct_play_offer() {
let source = source_fixture();
@@ -4313,7 +4313,7 @@ mod tests {
/// different one. Honouring the viewer's choice means asking the server to
/// build a stream around it.
///
/// TRACES: UR-021, UR-079 | DR-227 | UT-212
/// TRACES: UR-021, UR-079 | DR-228 | UT-213
#[test]
fn test_pinning_an_audio_track_forces_a_transcode() {
let source = source_fixture();
@@ -4329,7 +4329,7 @@ mod tests {
/// arrives here as `supports_direct_play: false`; this pins the mapping so a
/// future refactor cannot quietly direct-play past a cap.
///
/// TRACES: UR-074, UR-079 | DR-225, DR-227 | UT-212
/// TRACES: UR-074, UR-079 | DR-226, DR-228 | UT-213
#[test]
fn test_a_ceiling_below_the_source_bitrate_transcodes() {
// 6.65 Mbps source, 2 Mbps ceiling — the server refuses direct play.
@@ -4357,7 +4357,7 @@ mod tests {
/// Direct play wins over direct stream when both are on offer: copying the
/// file is strictly cheaper than repackaging it.
///
/// TRACES: UR-079 | DR-227 | UT-212
/// TRACES: UR-079 | DR-228 | UT-213
#[test]
fn test_direct_play_is_preferred_over_direct_stream() {
let source = source_fixture();
@@ -4369,15 +4369,15 @@ mod tests {
}
// -----------------------------------------------------------------------
// Per-playback quality ceiling (DR-225)
// Per-playback quality ceiling (DR-226)
// -----------------------------------------------------------------------
/// The defect DR-225 exists to fix: the in-player picker documented itself
/// The defect DR-226 exists to fix: the in-player picker documented itself
/// as a "this film, this connection" control but was implemented by writing
/// the device default, so one awkward film silently capped everything played
/// afterwards. The override must not touch the default.
///
/// TRACES: UR-074, UR-079 | DR-225 | UT-212
/// TRACES: UR-074, UR-079 | DR-226 | UT-213
#[test]
fn test_a_playback_override_does_not_disturb_the_device_default() {
let _guard = QUALITY_LOCK.lock_safe();
@@ -4410,7 +4410,7 @@ mod tests {
/// autoplayed next episode is the case that matters, since nobody reopens
/// the picker between episodes.
///
/// TRACES: UR-074, UR-079 | DR-225 | UT-212
/// TRACES: UR-074, UR-079 | DR-226 | UT-213
#[test]
fn test_the_override_is_droppable_so_it_cannot_outlive_its_playback() {
let _guard = QUALITY_LOCK.lock_safe();