11
This commit is contained in:
@@ -12,11 +12,14 @@ pub mod asr;
|
||||
pub mod auth_session;
|
||||
pub mod chat;
|
||||
pub mod commands;
|
||||
pub mod cover_python;
|
||||
pub mod ffmpeg;
|
||||
pub mod http;
|
||||
pub mod js_runtime;
|
||||
pub mod nodejs;
|
||||
pub mod oss;
|
||||
pub mod publish_db;
|
||||
pub mod publish_store;
|
||||
|
||||
use tauri::Manager;
|
||||
|
||||
@@ -30,6 +33,7 @@ pub fn run() {
|
||||
.manage(avatar_store::AvatarStore::new())
|
||||
.manage(audio_store::AudioStore::new())
|
||||
.manage(video_store::VideoStore::new())
|
||||
.manage(publish_store::PublishStore::new())
|
||||
.setup(|app| {
|
||||
let handle = app.handle().clone();
|
||||
tauri::async_runtime::block_on(async move {
|
||||
@@ -37,6 +41,7 @@ pub fn run() {
|
||||
let avatar_store = handle.state::<avatar_store::AvatarStore>();
|
||||
let audio_store = handle.state::<audio_store::AudioStore>();
|
||||
let video_store = handle.state::<video_store::VideoStore>();
|
||||
let publish_store = handle.state::<publish_store::PublishStore>();
|
||||
let dir = handle
|
||||
.path()
|
||||
.app_data_dir()
|
||||
@@ -46,6 +51,7 @@ pub fn run() {
|
||||
avatar_store.init(dir.join("avatars.db")).await?;
|
||||
audio_store.init(dir.join("generated_audios.db")).await?;
|
||||
video_store.init(dir.join("generated_videos.db")).await?;
|
||||
publish_store.init(dir.join("publish_accounts.db")).await?;
|
||||
Ok::<(), String>(())
|
||||
})
|
||||
.map_err(|e| -> Box<dyn std::error::Error> { e.into() })?;
|
||||
@@ -77,6 +83,7 @@ pub fn run() {
|
||||
commands::nodejs::run_nodejs_script_source,
|
||||
commands::nodejs::list_nodejs_scripts,
|
||||
commands::fs_util::read_local_file_base64,
|
||||
commands::fs_util::get_media_duration_seconds,
|
||||
commands::avatar::list_avatars,
|
||||
commands::avatar::insert_avatar,
|
||||
commands::avatar::update_avatar_name,
|
||||
@@ -90,7 +97,19 @@ pub fn run() {
|
||||
commands::video::insert_generated_video,
|
||||
commands::video::import_generated_video,
|
||||
commands::video::delete_generated_video,
|
||||
commands::publish::publish_list_accounts,
|
||||
commands::publish::publish_login,
|
||||
commands::publish::publish_check_login,
|
||||
commands::publish::publish_execute,
|
||||
commands::publish::publish_delete_account,
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
.build(tauri::generate_context!())
|
||||
.expect("error while building tauri application")
|
||||
.run(|app_handle, event| {
|
||||
if let tauri::RunEvent::Ready = event {
|
||||
if let Some(window) = app_handle.get_webview_window("main") {
|
||||
let _ = window.maximize();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user