diff --git a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/generic/handle_object_artcraft.rs b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/artcraft/handle_artcraft_object.rs similarity index 99% rename from crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/generic/handle_object_artcraft.rs rename to crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/artcraft/handle_artcraft_object.rs index 558ae0a403..fefafba42a 100644 --- a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/generic/handle_object_artcraft.rs +++ b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/artcraft/handle_artcraft_object.rs @@ -18,7 +18,7 @@ use storyteller_client::endpoints::generate::object::generate_hunyuan_3d_2_0_ima use storyteller_client::endpoints::generate::object::generate_hunyuan_3d_2_1_image_to_3d::generate_hunyuan3d_2_1_image_to_3d; use tauri::AppHandle; -pub async fn handle_object_artcraft( +pub async fn handle_artcraft_object( request: &EnqueueImageTo3dObjectRequest, app: &AppHandle, app_env_configs: &AppEnvConfigs, diff --git a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/artcraft/mod.rs b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/artcraft/mod.rs new file mode 100644 index 0000000000..f623ebcbe4 --- /dev/null +++ b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/artcraft/mod.rs @@ -0,0 +1 @@ +pub (super) mod handle_artcraft_object; diff --git a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/enqueue_image_to_3d_object_command.rs b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/enqueue_image_to_3d_object_command.rs index 1010df4223..b1c7320003 100644 --- a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/enqueue_image_to_3d_object_command.rs +++ b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/enqueue_image_to_3d_object_command.rs @@ -1,6 +1,6 @@ use crate::core::commands::enqueue::common::notify_frontend_of_errors::notify_frontend_of_errors; use crate::core::commands::enqueue::generate_error::{BadInputReason, GenerateError, MissingCredentialsReason}; -use crate::core::commands::enqueue::image_to_object::generic::handle_object::handle_object; +use crate::core::commands::enqueue::image_to_object::artcraft::handle_artcraft_object::handle_artcraft_object; use crate::core::commands::enqueue::task_enqueue_success::TaskEnqueueSuccess; use crate::core::commands::response::failure_response_wrapper::{CommandErrorResponseWrapper, CommandErrorStatus}; use crate::core::commands::response::shorthand::Response; @@ -14,10 +14,10 @@ use crate::core::state::provider_priority::{Provider, ProviderPriorityStore}; use crate::core::state::task_database::TaskDatabase; use crate::services::sora::state::sora_task_queue::SoraTaskQueue; use crate::services::storyteller::state::storyteller_credential_manager::StorytellerCredentialManager; +use enums::tauri::ux::tauri_command_caller::TauriCommandCaller; use log::{error, info, warn}; use serde_derive::{Deserialize, Serialize}; use tauri::{AppHandle, State}; -use enums::tauri::ux::tauri_command_caller::TauriCommandCaller; use tokens::tokens::media_files::MediaFileToken; #[derive(Deserialize)] @@ -174,12 +174,11 @@ pub async fn handle_request( storyteller_creds_manager: &StorytellerCredentialManager, ) -> Result { - let result = handle_object( + let result = handle_artcraft_object( &request, &app, &app_env_configs, &app_data_root, - &provider_priority_store, &storyteller_creds_manager, ).await; diff --git a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/generic/handle_object.rs b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/generic/handle_object.rs deleted file mode 100644 index 1934c8cfc7..0000000000 --- a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/generic/handle_object.rs +++ /dev/null @@ -1,40 +0,0 @@ -use crate::core::commands::enqueue::generate_error::GenerateError; -use crate::core::commands::enqueue::image_to_object::enqueue_image_to_3d_object_command::EnqueueImageTo3dObjectRequest; -use crate::core::commands::enqueue::image_to_object::generic::handle_object_artcraft::handle_object_artcraft; -use crate::core::commands::enqueue::image_to_object::generic::handle_object_fal::handle_object_fal; -use crate::core::commands::enqueue::task_enqueue_success::TaskEnqueueSuccess; -use crate::core::state::app_env_configs::app_env_configs::AppEnvConfigs; -use crate::core::state::data_dir::app_data_root::AppDataRoot; -use crate::core::state::provider_priority::{Provider, ProviderPriorityStore}; -use crate::services::storyteller::state::storyteller_credential_manager::StorytellerCredentialManager; -use tauri::AppHandle; - -pub async fn handle_object( - request: &EnqueueImageTo3dObjectRequest, - app: &AppHandle, - app_env_configs: &AppEnvConfigs, - app_data_root: &AppDataRoot, - provider_priority_store: &ProviderPriorityStore, - storyteller_creds_manager: &StorytellerCredentialManager, -) -> Result { - - let priority = provider_priority_store.get_priority()?; - - for provider in priority.iter() { - match provider { - Provider::Fal => {} // Fallthrough - Provider::Sora => {} // Fallthrough - Provider::Artcraft => { - return Ok(handle_object_artcraft( - request, - app, - app_env_configs, - app_data_root, - storyteller_creds_manager - ).await?); - } - } - } - - Err(GenerateError::NoProviderAvailable) -} diff --git a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/generic/handle_object_fal.rs b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/generic/handle_object_fal.rs deleted file mode 100644 index 191b4f27db..0000000000 --- a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/generic/handle_object_fal.rs +++ /dev/null @@ -1,15 +0,0 @@ -use crate::core::commands::enqueue::generate_error::GenerateError; -use crate::core::commands::enqueue::image_to_object::enqueue_image_to_3d_object_command::EnqueueImageTo3dObjectRequest; -use crate::core::commands::enqueue::task_enqueue_success::TaskEnqueueSuccess; -use crate::core::state::app_env_configs::app_env_configs::AppEnvConfigs; -use crate::core::state::data_dir::app_data_root::AppDataRoot; -use tauri::AppHandle; - -pub async fn handle_object_fal( - app: &AppHandle, - app_env_configs: &AppEnvConfigs, - app_data_root: &AppDataRoot, - request: EnqueueImageTo3dObjectRequest, -) -> Result { - Err(GenerateError::FalNoLongerSupported) -} diff --git a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/generic/mod.rs b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/generic/mod.rs deleted file mode 100644 index 59c1c262ef..0000000000 --- a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/generic/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub (super) mod handle_object; -pub (super) mod handle_object_artcraft; -pub (super) mod handle_object_fal; diff --git a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/mod.rs b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/mod.rs index db9c343df6..de940c5c8b 100644 --- a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/mod.rs +++ b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_object/mod.rs @@ -1,2 +1,2 @@ pub mod enqueue_image_to_3d_object_command; -mod generic; \ No newline at end of file +mod artcraft; \ No newline at end of file diff --git a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_video/enqueue_image_to_video_command.rs b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_video/enqueue_image_to_video_command.rs index 75f1937d01..1366e77ba1 100644 --- a/crates/desktop/artcraft/src/core/commands/enqueue/image_to_video/enqueue_image_to_video_command.rs +++ b/crates/desktop/artcraft/src/core/commands/enqueue/image_to_video/enqueue_image_to_video_command.rs @@ -2,7 +2,6 @@ use crate::core::commands::enqueue::common::notify_frontend_of_errors::notify_fr use crate::core::commands::enqueue::generate_error::{BadInputReason, GenerateError, MissingCredentialsReason, ProviderFailureReason}; use crate::core::commands::enqueue::image_to_video::artcraft::handle_artcraft_video::handle_video_artcraft; use crate::core::commands::enqueue::image_to_video::grok::handle_grok_video::handle_grok_video; -use crate::core::commands::enqueue::image_to_video::sora2::handle_sora2_video::handle_sora2_video; use crate::core::commands::enqueue::image_to_video::sora2::handle_sora_sora2::handle_sora_sora2; use crate::core::commands::enqueue::task_enqueue_success::TaskEnqueueSuccess; use crate::core::commands::response::failure_response_wrapper::{CommandErrorResponseWrapper, CommandErrorStatus};