Overview
TheMetaDetails model manages the detailed view of a content item (movie, series, etc.). It loads metadata from addons, available streams, user’s library state, watching progress, and rating information. This is the primary model for content details pages.
Structure
Fields
Currently selected meta item and optional stream
Meta item data loaded from all compatible addons
Streams embedded in the meta item’s videos
Streams loaded from stream addons
Recommended stream for binge watching based on user’s history
Library entry for this meta item, if it exists
User’s rating/like status for this item
Bitfield indicating which episodes have been watched
Selected
Path to the meta resource (contains type and ID)
Optional path to a specific video for loading streams
If
true and stream_path is None, automatically determine which video to load streams forStream Guessing
Whenguess_stream is true:
- Wait for all meta item requests to complete
- Find first successfully loaded meta item
- Use
behavior_hints.default_video_idif available - Otherwise, if no videos exist, use
meta_item.id - If videos exist but no default, don’t guess
- Update
stream_pathwith guessed video ID - Set
guess_streamtofalse
src/models/meta_details.rs:387
Update Implementation
ImplementsUpdateWithCtx<E> for state management:
Supported Messages
Action::Load::MetaDetails
Action::Load::MetaDetails
Loads detailed information for a meta item:
- Loads meta items from all addons
- Loads streams if video is specified
- Loads library item if it exists
- Computes watched bitfield
- Loads rating info if supported
- Dismisses notifications for this item
- Syncs library item to cloud if authenticated
src/models/meta_details.rs:71Action::Unload
Action::Unload
Clears all meta details stateSource:
src/models/meta_details.rs:113Action::MetaDetails::MarkAsWatched
Action::MetaDetails::MarkAsWatched
Marks the entire item as watched or unwatched:
- Updates library item’s
flagged_watched - For series, marks all episodes
- Sends update to library
src/models/meta_details.rs:132Action::MetaDetails::MarkVideoAsWatched
Action::MetaDetails::MarkVideoAsWatched
Marks a specific video (episode) as watched or unwatched:
- Updates watched bitfield
- Updates library item state
- Syncs to cloud
src/models/meta_details.rs:143Action::MetaDetails::MarkSeasonAsWatched
Action::MetaDetails::MarkSeasonAsWatched
Marks all episodes in a season as watched or unwatched:
- Finds all videos for the season
- Updates watched bitfield for each
- Updates library item state
src/models/meta_details.rs:156Action::MetaDetails::Rate
Action::MetaDetails::Rate
Sends a rating (like/dislike) for the meta item:
- Only works for supported ID prefixes and types
- Requires authentication
- Updates rating_info on success
- Emits
Event::MetaItemRated
src/models/meta_details.rs:183Internal::ResourceRequestResult (meta)
Internal::ResourceRequestResult (meta)
Processes meta resource responses:
- Updates meta_items with loaded data
- Triggers stream guessing if enabled
- Updates meta_streams from video streams
- Updates last_used_stream recommendation
- Updates library item
- Recomputes watched bitfield
src/models/meta_details.rs:202Internal::ResourceRequestResult (stream)
Internal::ResourceRequestResult (stream)
Processes stream resource responses:
- Updates streams with loaded data
- Updates last_used_stream recommendation
src/models/meta_details.rs:242Internal::RatingGetStatusResult
Internal::RatingGetStatusResult
Processes rating status response:
- Updates rating_info with user’s current rating
- Sets to Error if request failed
src/models/meta_details.rs:259Internal::RatingSendResult
Internal::RatingSendResult
Processes rating submission response:
- Updates rating_info with new status
- Emits
Event::MetaItemRatedon success - Shows error event on failure
src/models/meta_details.rs:275Internal::LibraryChanged
Internal::LibraryChanged
Updates library item and watched state when library changes externallySource:
src/models/meta_details.rs:320Internal::ProfileChanged
Internal::ProfileChanged
Reloads all data when profile changes (addons, auth):
- Reloads meta items from new addon set
- Reloads streams
- Updates rating info availability
src/models/meta_details.rs:331Last Used Stream
The model automatically determines the best stream for binge watching:This ensures users continue watching from the same source/quality when binge watching a series.
src/models/meta_details.rs:641
Rating Support
Rating is only available for certain items:Supported ID Prefixes
Defined inUSER_LIKES_SUPPORTED_ID_PREFIXES:
- IMDb IDs (
tt...) - Other configured prefixes
Supported Types
Defined inUSER_LIKES_SUPPORTED_TYPES:
movieseries- Other configured types
src/models/meta_details.rs:477
Library Sync
When loading a meta item, the model syncs the library item to the cloud:src/models/meta_details.rs:370
Usage Example
State Diagram
Events
The model emits:Event::MetaItemRated { id }- User rated the itemEvent::Error- Rating or loading errors
See Also
- MetaItem - Meta item structure
- Stream - Stream structure
- LibraryItem - Library item structure
- Player - Player model for playback
