mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-19 14:22:19 +02:00
feat: add media-server input foundations (#742)
* feat: add remote media input foundations * fixed macro variable names * Added todo comment for source editor sidebar
This commit is contained in:
@@ -507,6 +507,16 @@ async fn playlist_download_from_input(
|
||||
let (p, e) = library::download_library_playlist(client, app_config, input).await;
|
||||
(p, e, false, 0, 0)
|
||||
}
|
||||
InputType::Emby | InputType::Jellyfin | InputType::Plex => (
|
||||
vec![],
|
||||
vec![TuliproxError::Download(format!(
|
||||
"media-server input '{}' is configured but catalog import is not implemented yet",
|
||||
input.name
|
||||
))],
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ pub enum GenericProbeMetadataOutcome {
|
||||
}
|
||||
|
||||
fn requires_provider_connection_for_generic_probe(input_type: InputType) -> bool {
|
||||
!matches!(input_type, InputType::Library)
|
||||
!(matches!(input_type, InputType::Library) || input_type.is_media_server())
|
||||
}
|
||||
|
||||
fn uses_seekable_remote_probe(item_type: PlaylistItemType, is_remote_probe: bool) -> bool {
|
||||
@@ -183,13 +183,14 @@ async fn prepare_generic_stream_metadata(
|
||||
XtreamCluster::Series
|
||||
} else {
|
||||
// Generic probing currently supports live/video/series payload shapes.
|
||||
return Ok(PreparedGenericProbeOutcome::Noop);
|
||||
return Ok(PreparedGenericProbeOutcome::Noop);
|
||||
};
|
||||
(
|
||||
xtream_get_file_path(&storage_path, cluster),
|
||||
ProbeStorageKind::Xtream,
|
||||
)
|
||||
}
|
||||
InputType::Emby | InputType::Jellyfin | InputType::Plex => return Ok(PreparedGenericProbeOutcome::Noop),
|
||||
};
|
||||
|
||||
if !db_path.exists() {
|
||||
@@ -532,6 +533,13 @@ mod tests {
|
||||
assert!(!requires_provider_connection_for_generic_probe(InputType::Library));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn media_server_probe_does_not_require_provider_connection() {
|
||||
assert!(!requires_provider_connection_for_generic_probe(InputType::Emby));
|
||||
assert!(!requires_provider_connection_for_generic_probe(InputType::Jellyfin));
|
||||
assert!(!requires_provider_connection_for_generic_probe(InputType::Plex));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn m3u_probe_requires_provider_connection() {
|
||||
assert!(requires_provider_connection_for_generic_probe(InputType::M3u));
|
||||
|
||||
Reference in New Issue
Block a user