game_manager_lib/commands/platforms/
ubisoft.rs1use crate::commands::platforms::core::spawn_import;
2use crate::errors::AppError;
3use tauri::AppHandle;
4
5#[tauri::command]
6pub async fn import_ubisoft_games(
7 app: AppHandle,
8 wine_prefix: Option<String>,
9) -> Result<(), AppError> {
10 use crate::sources::providers::GameSource;
11 use crate::sources::ubisoft::UbisoftSource;
12
13 let prefix = wine_prefix
14 .filter(|s| !s.trim().is_empty())
15 .map(std::path::PathBuf::from);
16
17 spawn_import(app, "Ubisoft", |_app| async move {
18 UbisoftSource::new(true, prefix).fetch_games().await
19 });
20 Ok(())
21}