pub struct MediaItem {Show 25 fields
pub id: String,
pub title: String,
pub name: Option<String>,
pub artist: Option<String>,
pub album: Option<String>,
pub album_name: Option<String>,
pub album_id: Option<String>,
pub artist_items: Option<Vec<ArtistItem>>,
pub artists: Option<Vec<String>>,
pub primary_image_tag: Option<String>,
pub image_id: Option<String>,
pub item_type: Option<String>,
pub playlist_id: Option<String>,
pub duration: Option<f64>,
pub artwork_url: Option<String>,
pub media_type: MediaType,
pub source: MediaSource,
pub video_codec: Option<String>,
pub needs_transcoding: bool,
pub transport: Option<Transport>,
pub video_width: Option<u32>,
pub video_height: Option<u32>,
pub subtitles: Vec<SubtitleTrack>,
pub series_id: Option<String>,
pub server_id: Option<String>,
}Expand description
Represents a media item that can be played
TRACES: UR-003, UR-004 | DR-002
Fields§
§id: StringUnique identifier
title: StringDisplay title
name: Option<String>Name (alias for title - for frontend compatibility)
artist: Option<String>Artist name(s) for audio
album: Option<String>Album name for audio
album_name: Option<String>Album name (alias - for frontend compatibility)
album_id: Option<String>Album ID (Jellyfin ID) for remote transfer context
artist_items: Option<Vec<ArtistItem>>Artist items with IDs for clickable links
artists: Option<Vec<String>>Artists as array of strings (fallback when artist_items not available)
primary_image_tag: Option<String>Primary image tag for artwork.
Legacy Jellyfin name; being replaced by image_id (same value). Dual-carried
while the frontend migrates (docs/specs/frontend-domain-model.md).
image_id: Option<String>Neutral image identifier the frontend resolves to a URL — replaces
primary_image_tag.
item_type: Option<String>Item type (Audio, Movie, Episode, etc.)
playlist_id: Option<String>Playlist ID (Jellyfin ID) for remote transfer context
duration: Option<f64>Duration in seconds
artwork_url: Option<String>URL or path to artwork image
media_type: MediaTypeType of media
source: MediaSourceSource of the media
video_codec: Option<String>Video codec (e.g., “h264”, “hevc”) for video media
needs_transcoding: boolWhether the video requires server-side transcoding
transport: Option<Transport>How this item’s stream is fetched, as the backend decided it.
Carried on the queue item so a later seek/reload does not have to guess.
None for items queued by a path that never negotiated (audio tracks,
direct URLs) and for anything queued before this field existed, where the
caller falls back to needs_transcoding — every transcode this app
requests is HLS (DR-140), so that fallback is exact rather than a guess.
TRACES: UR-003, UR-004, UR-079 | DR-225, DR-230
video_width: Option<u32>Video width in pixels
video_height: Option<u32>Video height in pixels
subtitles: Vec<SubtitleTrack>Available subtitle tracks
series_id: Option<String>Series ID (for TV show episodes) - used for series audio preferences
server_id: Option<String>Server ID - used for series audio preferences
Implementations§
Source§impl MediaItem
impl MediaItem
Sourcepub fn jellyfin_id(&self) -> Option<&str>
pub fn jellyfin_id(&self) -> Option<&str>
Get the Jellyfin item ID if available
Sourcepub fn playback_url(&self) -> String
pub fn playback_url(&self) -> String
The URL or path an engine should open.
Not gated to Android any more. It was, back when only ExoPlayer needed
direct URL access — and that gate is why a byte-identical copy was later
added for the cross-platform MediaPlayer::open path without anyone
noticing this existed: it is invisible in a Linux build, so nothing
warned. Two matches over MediaSource meant a new variant could be
handled in one and forgotten in the other, silently.
TRACES: UR-081 | DR-245, DR-255
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MediaItem
impl<'de> Deserialize<'de> for MediaItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&MediaItem> for MergedMediaItem
impl From<&MediaItem> for MergedMediaItem
Source§impl NamedType for MediaItem
impl NamedType for MediaItem
fn sid() -> SpectaID
Source§fn named_data_type(
type_map: &mut TypeCollection,
generics: &[DataType],
) -> NamedDataType
fn named_data_type( type_map: &mut TypeCollection, generics: &[DataType], ) -> NamedDataType
Source§fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
Source§impl Type for MediaItem
impl Type for MediaItem
Source§fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
Source§fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
definition will be put into the type map.impl Flatten for MediaItem
impl StructuralPartialEq for MediaItem
Auto Trait Implementations§
impl Freeze for MediaItem
impl RefUnwindSafe for MediaItem
impl Send for MediaItem
impl Sync for MediaItem
impl Unpin for MediaItem
impl UnsafeUnpin for MediaItem
impl UnwindSafe for MediaItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
§impl<T> FunctionArg for Twhere
T: Type,
impl<T> FunctionArg for Twhere
T: Type,
§fn to_datatype(type_map: &mut TypeCollection) -> Option<DataType>
fn to_datatype(type_map: &mut TypeCollection) -> Option<DataType>
DataType]. Read more