Merge branch 'master' of ssh://gitea.bowongai.com:221/bowong/mxivideo
This commit is contained in:
commit
7306d12164
|
|
@ -51,24 +51,19 @@ pub async fn get_project_info(project_path: String) -> Result<ProjectInfo, Strin
|
||||||
Ok(project_info)
|
Ok(project_info)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 根据ID获取项目详情
|
|
||||||
#[command]
|
|
||||||
pub async fn get_project_by_id(project_id: String) -> Result<String, String> {
|
|
||||||
let args = serde_json::json!({
|
|
||||||
"project_id": project_id
|
|
||||||
});
|
|
||||||
|
|
||||||
execute_python_command("project_manager", "get_project_by_id", Some(args)).await
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 扫描目录文件
|
/// 扫描目录文件
|
||||||
#[command]
|
#[command]
|
||||||
pub async fn scan_directory(directory_path: String) -> Result<String, String> {
|
pub async fn scan_directory(app: AppHandle, directory_path: String) -> Result<String, String> {
|
||||||
let args = serde_json::json!({
|
let args = vec![
|
||||||
"directory_path": directory_path
|
"-m".to_string(),
|
||||||
});
|
"python_core.services.file_manager".to_string(),
|
||||||
|
"scan_directory".to_string(),
|
||||||
|
directory_path,
|
||||||
|
];
|
||||||
|
|
||||||
execute_python_command("file_manager", "scan_directory", Some(args)).await
|
execute_python_command(app, &args, None).await
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 在系统中打开文件
|
/// 在系统中打开文件
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,9 @@ pub fn run() {
|
||||||
commands::delete_project,
|
commands::delete_project,
|
||||||
commands::search_projects,
|
commands::search_projects,
|
||||||
commands::open_project_directory,
|
commands::open_project_directory,
|
||||||
|
commands::project::scan_directory,
|
||||||
|
commands::project::open_file_in_system,
|
||||||
|
commands::project::delete_file,
|
||||||
commands::model::get_all_models,
|
commands::model::get_all_models,
|
||||||
commands::model::get_model_by_id,
|
commands::model::get_model_by_id,
|
||||||
commands::model::create_model,
|
commands::model::create_model,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue