Skip to main content

## MediaRepository

# Trait MediaRepository

Source

    pub trait MediaRepository: Send + Sync {
    Show 38 methods    // Required methods
        fn get_libraries<'life0, 'async_trait>(
            &'life0 self,
        ) -> Pin<Box<dyn Future<Output = Result<Vec<Library>, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait;
        fn get_items<'life0, 'life1, 'async_trait>(
            &'life0 self,
            parent_id: &'life1 str,
            options: Option<GetItemsOptions>,
        ) -> Pin<Box<dyn Future<Output = Result<SearchResult, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_item<'life0, 'life1, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
        ) -> Pin<Box<dyn Future<Output = Result<MediaItem, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_latest_items<'life0, 'life1, 'async_trait>(
            &'life0 self,
            parent_id: &'life1 str,
            limit: Option<usize>,
        ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_resume_items<'life0, 'life1, 'async_trait>(
            &'life0 self,
            parent_id: Option<&'life1 str>,
            limit: Option<usize>,
        ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_next_up_episodes<'life0, 'life1, 'async_trait>(
            &'life0 self,
            series_id: Option<&'life1 str>,
            limit: Option<usize>,
        ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_recently_played_audio<'life0, 'async_trait>(
            &'life0 self,
            limit: Option<usize>,
        ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait;
        fn get_rediscover_albums<'life0, 'life1, 'async_trait>(
            &'life0 self,
            parent_id: Option<&'life1 str>,
            limit: Option<usize>,
        ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_resume_movies<'life0, 'async_trait>(
            &'life0 self,
            limit: Option<usize>,
        ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait;
        fn get_genres<'life0, 'life1, 'async_trait>(
            &'life0 self,
            parent_id: Option<&'life1 str>,
        ) -> Pin<Box<dyn Future<Output = Result<Vec<Genre>, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn search<'life0, 'life1, 'async_trait>(
            &'life0 self,
            query: &'life1 str,
            options: Option<SearchOptions>,
        ) -> Pin<Box<dyn Future<Output = Result<SearchResult, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_playback_info<'life0, 'life1, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
        ) -> Pin<Box<dyn Future<Output = Result<PlaybackInfo, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_audio_stream_url<'life0, 'life1, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
        ) -> Pin<Box<dyn Future<Output = Result<String, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_audio_only_stream_url_for_video<'life0, 'life1, 'life2, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
            media_source_id: Option<&'life2 str>,
            start_time_seconds: Option<f64>,
            audio_stream_index: Option<i32>,
        ) -> Pin<Box<dyn Future<Output = Result<String, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait,
                 'life2: 'async_trait;
        fn get_live_tv_channels<'life0, 'async_trait>(
            &'life0 self,
        ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait;
        fn get_channels<'life0, 'async_trait>(
            &'life0 self,
        ) -> Pin<Box<dyn Future<Output = Result<SearchResult, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait;
        fn open_live_stream<'life0, 'life1, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
        ) -> Pin<Box<dyn Future<Output = Result<LiveStreamInfo, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn report_playback_start<'life0, 'life1, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
            position_ticks: i64,
        ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn report_playback_progress<'life0, 'life1, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
            position_ticks: i64,
        ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn report_playback_stopped<'life0, 'life1, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
            position_ticks: i64,
        ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_image_url(
            &self,
            item_id: &str,
            image_type: ImageType,
            options: Option<ImageOptions>,
        ) -> String;
        fn get_subtitle_url(
            &self,
            item_id: &str,
            media_source_id: &str,
            stream_index: i32,
            format: &str,
        ) -> String;
        fn get_video_download_url(
            &self,
            item_id: &str,
            quality: &str,
            media_source_id: Option<&str>,
            source_audio_codec: Option<&str>,
        ) -> String;
        fn mark_favorite<'life0, 'life1, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
        ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn unmark_favorite<'life0, 'life1, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
        ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_favorites<'life0, 'async_trait>(
            &'life0 self,
            scope: SearchScope,
            options: Option<GetItemsOptions>,
        ) -> Pin<Box<dyn Future<Output = Result<SearchResult, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait;
        fn clear_watch_history<'life0, 'life1, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
        ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn mark_played<'life0, 'life1, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
        ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_person<'life0, 'life1, 'async_trait>(
            &'life0 self,
            person_id: &'life1 str,
        ) -> Pin<Box<dyn Future<Output = Result<MediaItem, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_items_by_person<'life0, 'life1, 'async_trait>(
            &'life0 self,
            person_id: &'life1 str,
            options: Option<GetItemsOptions>,
        ) -> Pin<Box<dyn Future<Output = Result<SearchResult, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn get_similar_items<'life0, 'life1, 'async_trait>(
            &'life0 self,
            item_id: &'life1 str,
            limit: Option<usize>,
        ) -> Pin<Box<dyn Future<Output = Result<SearchResult, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn create_playlist<'life0, 'life1, 'life2, 'async_trait>(
            &'life0 self,
            name: &'life1 str,
            item_ids: &'life2 [String],
        ) -> Pin<Box<dyn Future<Output = Result<PlaylistCreatedResult, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait,
                 'life2: 'async_trait;
        fn delete_playlist<'life0, 'life1, 'async_trait>(
            &'life0 self,
            playlist_id: &'life1 str,
        ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn rename_playlist<'life0, 'life1, 'life2, 'async_trait>(
            &'life0 self,
            playlist_id: &'life1 str,
            name: &'life2 str,
        ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait,
                 'life2: 'async_trait;
        fn get_playlist_items<'life0, 'life1, 'async_trait>(
            &'life0 self,
            playlist_id: &'life1 str,
        ) -> Pin<Box<dyn Future<Output = Result<Vec<PlaylistEntry>, RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait;
        fn add_to_playlist<'life0, 'life1, 'life2, 'async_trait>(
            &'life0 self,
            playlist_id: &'life1 str,
            item_ids: &'life2 [String],
        ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait,
                 'life2: 'async_trait;
        fn remove_from_playlist<'life0, 'life1, 'life2, 'async_trait>(
            &'life0 self,
            playlist_id: &'life1 str,
            entry_ids: &'life2 [String],
        ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait,
                 'life2: 'async_trait;
        fn move_playlist_item<'life0, 'life1, 'life2, 'async_trait>(
            &'life0 self,
            playlist_id: &'life1 str,
            item_id: &'life2 str,
            new_index: u32,
        ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
           where Self: 'async_trait,
                 'life0: 'async_trait,
                 'life1: 'async_trait,
                 'life2: 'async_trait;
    }

Expand description

Repository trait for media access (online, offline, or hybrid)

@req: UR-002 - Access media when online or offline @req: UR-007 - Navigate media in library @req: UR-008 - Search media across libraries @req: IR-010 - Jellyfin API client for library browsing @req: DR-012 - Local database for media metadata cache @req: DR-013 - Repository pattern for online/offline data access

## Required Methods§

Source

#### fn get_libraries<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Library>, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all libraries

@req: UR-007 - Navigate media in library @req: JA-003 - Get user library views

Source

#### fn get_items<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, options: Option<GetItemsOptions>, ) -> Pin<Box<dyn Future<Output = Result<SearchResult, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get items in a library or parent

@req: UR-007 - Navigate media in library @req: JA-004 - Get library items (paginated)

Source

#### fn get_item<'life0, 'life1, 'async_trait>( &'life0 self, item_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<MediaItem, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a single item by ID

@req: UR-007 - Navigate media in library @req: JA-005 - Get item details and metadata

Source

#### fn get_latest_items<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get latest items in a library

@req: UR-024 - View recently added content on server @req: JA-016 - Get recently added items

Source

#### fn get_resume_items<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: Option<&'life1 str>, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get resume items (continue watching/listening)

@req: UR-019 - Resume playback from where you left off @req: UR-023 - View “Next Up” / Continue Watching on home screen @req: JA-015 - Get “Continue Watching” items

Source

#### fn get_next_up_episodes<'life0, 'life1, 'async_trait>( &'life0 self, series_id: Option<&'life1 str>, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get next up episodes

@req: UR-023 - View “Next Up” / Continue Watching; auto-play next episode @req: JA-014 - Get “Next Up” items

Source

#### fn get_recently_played_audio<'life0, 'async_trait>( &'life0 self, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get recently played audio

Source

#### fn get_rediscover_albums<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: Option<&'life1 str>, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get albums the user has played, but not recently (“rediscover” / haven’t listened to in a while). Returns albums sorted by least-recently played first, optionally restricted to a parent library.

Source

#### fn get_resume_movies<'life0, 'async_trait>( &'life0 self, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get resume movies

Source

#### fn get_genres<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Genre>, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get genres

Source

#### fn search<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, options: Option<SearchOptions>, ) -> Pin<Box<dyn Future<Output = Result<SearchResult, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Search for items

@req: UR-008 - Search media across libraries @req: JA-006 - Search across libraries

Source

#### fn get_playback_info<'life0, 'life1, 'async_trait>( &'life0 self, item_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<PlaybackInfo, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get playback info for streaming

@req: UR-003 - Play videos @req: UR-004 - Play audio uninterrupted @req: JA-007 - Get playback info and stream URL

Source

#### fn get_audio_stream_url<'life0, 'life1, 'async_trait>( &'life0 self, item_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<String, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get audio stream URL for a track

@req: UR-004 - Play audio uninterrupted @req: JA-007 - Get playback info and stream URL

Source

#### fn get_audio_only_stream_url_for_video<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, item_id: &'life1 str, media_source_id: Option<&'life2 str>, start_time_seconds: Option<f64>, audio_stream_index: Option<i32>, ) -> Pin<Box<dyn Future<Output = Result<String, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get an audio-only stream URL for a video item (background-audio handoff).

Used when autoplay advances to the next episode while the app is playing a video in audio-only mode in the background: the backend needs the next episode’s audio-only URL without any frontend round-trip. Online-only; offline/cache repositories return an error.

TRACES: UR-040 | JA-032

Source

#### fn get_live_tv_channels<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<MediaItem>, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get Live TV channels (broadcast / IPTV) for browsing.

Source

#### fn get_channels<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SearchResult, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the root list of plugin “Channels” (Jellyfin Channels feature). Drill-down into a channel reuses `get_items(channel_id, ...)`.

Source

#### fn open_live_stream<'life0, 'life1, 'async_trait>( &'life0 self, item_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<LiveStreamInfo, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Open a live stream (Live TV channel or live channel item) for playback.

Returns the server transcoding URL plus identifiers needed to manage the stream. Required before a live channel can be played over HLS.

Source

#### fn report_playback_start<'life0, 'life1, 'async_trait>( &'life0 self, item_id: &'life1 str, position_ticks: i64, ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Report playback start

@req: UR-025 - Sync watch history and progress back to Jellyfin @req: JA-010 - Report playback start

Source

#### fn report_playback_progress<'life0, 'life1, 'async_trait>( &'life0 self, item_id: &'life1 str, position_ticks: i64, ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Report playback progress

@req: UR-025 - Sync watch history and progress back to Jellyfin @req: JA-011 - Report playback progress (periodic)

Source

#### fn report_playback_stopped<'life0, 'life1, 'async_trait>( &'life0 self, item_id: &'life1 str, position_ticks: i64, ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Report playback stopped

@req: UR-025 - Sync watch history and progress back to Jellyfin @req: JA-012 - Report playback stopped

Source

#### fn get_image_url( &self, item_id: &str, image_type: ImageType, options: Option<ImageOptions>, ) -> String

Get image URL (synchronous - just constructs URL)

Source

#### fn get_subtitle_url( &self, item_id: &str, media_source_id: &str, stream_index: i32, format: &str, ) -> String

Get subtitle URL (synchronous - just constructs URL) Called by frontend via Tauri invoke (getSubtitleUrl in VideoPlayer.svelte)

Source

#### fn get_video_download_url( &self, item_id: &str, quality: &str, media_source_id: Option<&str>, source_audio_codec: Option<&str>, ) -> String

Build the URL a video download is fetched from. Synchronous — it only constructs a URL, so it stays testable without a server. Reach it through `resolve_video_download_url` rather than calling it directly.

`source_audio_codec` is the codec of the audio track the server would serve (see `served_audio_codec`); `None` when it is not known. At `original` quality it decides whether the file can be copied byte-for-byte or has to have its audio re-encoded on the way down — a downloaded file is played back with no server in reach, so it has to be decodable here.

TRACES: UR-071 | DR-171

Source

#### fn mark_favorite<'life0, 'life1, 'async_trait>( &'life0 self, item_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mark item as favorite

Source

#### fn unmark_favorite<'life0, 'life1, 'async_trait>( &'life0 self, item_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unmark item as favorite

Source

#### fn get_favorites<'life0, 'async_trait>( &'life0 self, scope: SearchScope, options: Option<GetItemsOptions>, ) -> Pin<Box<dyn Future<Output = Result<SearchResult, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Everything the viewer has favourited, across every library.

Separate from `get_items` because favourites span libraries and `get_items` is `ParentId`-shaped. `scope` is the opaque enum the frontend sends; this layer expands it to item types (DR-063) so no Jellyfin taxonomy is needed on the other side of the IPC boundary.

TRACES: UR-067 | DR-115, JA-033 | UT-100, UT-101

Source

#### fn clear_watch_history<'life0, 'life1, 'async_trait>( &'life0 self, item_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Erase the viewer’s watch history for an item: clear its played flag and its resume position. On a container (series, season) this applies to everything inside it, so a series is returned to “never watched” and reopens on its premiere.

TRACES: UR-064 | DR-106

Source

#### fn mark_played<'life0, 'life1, 'async_trait>( &'life0 self, item_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mark an item played — the inverse of `clear_watch_history`. Needed by the sync-queue drain, which replays `mark_played` rows queued while the server was unreachable; reporting a stop at a made-up position was the previous stand-in and does not set the played flag reliably.

TRACES: UR-025 | DR-131 | JA-035

Source

#### fn get_person<'life0, 'life1, 'async_trait>( &'life0 self, person_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<MediaItem, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get person details

Source

#### fn get_items_by_person<'life0, 'life1, 'async_trait>( &'life0 self, person_id: &'life1 str, options: Option<GetItemsOptions>, ) -> Pin<Box<dyn Future<Output = Result<SearchResult, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get items by person (filmography)

Source

#### fn get_similar_items<'life0, 'life1, 'async_trait>( &'life0 self, item_id: &'life1 str, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<SearchResult, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get similar/related items for a movie or show

@req: UR-009 - Discover similar content based on current item

Source

#### fn create_playlist<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, name: &'life1 str, item_ids: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<PlaylistCreatedResult, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Create a new playlist on the server

@req: UR-014 - Make and edit playlists of music that sync back to Jellyfin @req: JA-019 - Get/create/update playlists

Source

#### fn delete_playlist<'life0, 'life1, 'async_trait>( &'life0 self, playlist_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a playlist

@req: UR-014 - Make and edit playlists of music that sync back to Jellyfin @req: JA-019 - Get/create/update playlists

Source

#### fn rename_playlist<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, playlist_id: &'life1 str, name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Rename a playlist

@req: UR-014 - Make and edit playlists of music that sync back to Jellyfin @req: JA-019 - Get/create/update playlists

Source

#### fn get_playlist_items<'life0, 'life1, 'async_trait>( &'life0 self, playlist_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<PlaylistEntry>, RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get playlist items with PlaylistItemId (needed for remove/reorder)

@req: UR-014 - Make and edit playlists of music that sync back to Jellyfin @req: JA-019 - Get/create/update playlists

Source

#### fn add_to_playlist<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, playlist_id: &'life1 str, item_ids: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Add items to a playlist

@req: UR-014 - Make and edit playlists of music that sync back to Jellyfin @req: JA-020 - Add/remove items from playlist

Source

#### fn remove_from_playlist<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, playlist_id: &'life1 str, entry_ids: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Remove items from a playlist using entry IDs (PlaylistItemId, NOT media item IDs)

@req: UR-014 - Make and edit playlists of music that sync back to Jellyfin @req: JA-020 - Add/remove items from playlist

Source

#### fn move_playlist_item<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, playlist_id: &'life1 str, item_id: &'life2 str, new_index: u32, ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Move a playlist item to a new position

@req: UR-014 - Make and edit playlists of music that sync back to Jellyfin @req: JA-020 - Add/remove items from playlist

## Implementors§

Source §

### impl MediaRepository for HybridRepository

Source §

### impl MediaRepository for OfflineRepository

Source §

### impl MediaRepository for OnlineRepository