feat: implement multi-provider support in media library
- Introduced IProviderRegistry to manage multiple media providers. - Updated AppState to use provider_registry instead of a single media_provider. - Refactored library routes to support provider-specific queries for collections, series, genres, and items. - Enhanced ProgrammingBlock to include provider_id for algorithmic and manual content types. - Modified frontend components to allow selection of providers and updated API calls to include provider parameters. - Adjusted hooks and types to accommodate provider-specific functionality.
This commit is contained in:
@@ -214,7 +214,7 @@ impl ProgrammingBlock {
|
||||
name: name.into(),
|
||||
start_time,
|
||||
duration_mins,
|
||||
content: BlockContent::Algorithmic { filter, strategy },
|
||||
content: BlockContent::Algorithmic { filter, strategy, provider_id: String::new() },
|
||||
loop_on_finish: true,
|
||||
ignore_recycle_policy: false,
|
||||
access_mode: AccessMode::default(),
|
||||
@@ -233,7 +233,7 @@ impl ProgrammingBlock {
|
||||
name: name.into(),
|
||||
start_time,
|
||||
duration_mins,
|
||||
content: BlockContent::Manual { items },
|
||||
content: BlockContent::Manual { items, provider_id: String::new() },
|
||||
loop_on_finish: true,
|
||||
ignore_recycle_policy: false,
|
||||
access_mode: AccessMode::default(),
|
||||
@@ -247,11 +247,21 @@ impl ProgrammingBlock {
|
||||
#[serde(tag = "type", rename_all = "snake_case")]
|
||||
pub enum BlockContent {
|
||||
/// The user hand-picked specific items in a specific order.
|
||||
Manual { items: Vec<MediaItemId> },
|
||||
/// Item IDs are prefixed with the provider key (e.g. `"jellyfin::abc123"`)
|
||||
/// so the registry can route each fetch to the correct provider.
|
||||
Manual {
|
||||
items: Vec<MediaItemId>,
|
||||
/// Registry key of the provider these items come from. Empty string = primary.
|
||||
#[serde(default)]
|
||||
provider_id: String,
|
||||
},
|
||||
/// The engine selects items from the provider using the given filter and strategy.
|
||||
Algorithmic {
|
||||
filter: MediaFilter,
|
||||
strategy: FillStrategy,
|
||||
/// Registry key of the provider to query. Empty string = primary.
|
||||
#[serde(default)]
|
||||
provider_id: String,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user