Skip to main content

## repository_get_stream_selection

# Function repository_get_stream_selection

Source

    pub async fn repository_get_stream_selection(
        manager: State<'_, RepositoryManagerWrapper>,
        handle: String,
        item_id: String,
        media_source_id: Option<String>,
        audio_stream_index: Option<i32>,
    ) -> Result<StreamSelection, String>

Expand description

Decide what stream to play for a video, and describe it.

Replaces `repository_get_video_stream_url` for playback. The returned `StreamSelection` carries the transport explicitly, so the frontend picks its loader from a tagged enum instead of testing the URL for `.m3u8`; and it carries the quality ladder as it applies to this source, so the picker can stop offering rungs that produce the same bytes as Original.

No start-position parameter, for the same reason as the URL builder: a position on an HLS playlist is copied onto every segment URI and the server rejects each with `400` (DR-181). Callers resume by seeking after load.

TRACES: UR-070, UR-079 | DR-225, DR-227, DR-228 | UT-213