2026-09-21 10:57:43 -04:00
|
|
|
use crate::models::{CookieSource, VideoMetadata};
|
|
|
|
|
use crate::services::video_resolver;
|
|
|
|
|
|
|
|
|
|
#[tauri::command]
|
|
|
|
|
pub async fn resolve_url(
|
|
|
|
|
url: String,
|
|
|
|
|
cookie_source: CookieSource,
|
|
|
|
|
) -> Result<VideoMetadata, String> {
|
|
|
|
|
tokio::task::spawn_blocking(move || video_resolver::resolve(&url, &cookie_source))
|
|
|
|
|
.await
|
|
|
|
|
.map_err(|e| format!("Task failed: {e}"))?
|
|
|
|
|
}
|