diff --git a/src/modes/server/api/status.rs b/src/modes/server/api/status.rs index 7de5adb..2d8d4f6 100644 --- a/src/modes/server/api/status.rs +++ b/src/modes/server/api/status.rs @@ -29,9 +29,12 @@ pub async fn handle_status( // Get database path let db_path = state.db.lock().await.path().unwrap_or("unknown").to_string(); - // Use the status service to generate status info showing all supported plugins + // Use the status service to generate status info showing configured plugins let status_service = crate::services::status_service::StatusService::new(); - let status_info = status_service.generate_supported_status( + let mut cmd = state.cmd.lock().await; + let status_info = status_service.generate_status( + &mut cmd, + &state.settings, state.data_dir.clone(), db_path.into(), ); diff --git a/src/services/meta_service.rs b/src/services/meta_service.rs index db5e48e..b0fa052 100644 --- a/src/services/meta_service.rs +++ b/src/services/meta_service.rs @@ -15,17 +15,9 @@ impl MetaService { pub fn get_plugins(&self, cmd: &mut Command, settings: &Settings) -> Vec> { debug!("META_SERVICE: get_plugins called"); - let mut meta_plugin_types: Vec = settings_meta_plugin_types(cmd, settings); + let meta_plugin_types: Vec = settings_meta_plugin_types(cmd, settings); debug!("META_SERVICE: Meta plugin types from settings: {:?}", meta_plugin_types); - // Always add the Digest plugin if not present - if !meta_plugin_types.contains(&MetaPluginType::Digest) { - debug!("META_SERVICE: Adding digest plugin type"); - meta_plugin_types.push(MetaPluginType::Digest); - } - - debug!("META_SERVICE: Meta plugin types: {:?}", meta_plugin_types); - // Create plugins with their configuration let meta_plugins: Vec> = meta_plugin_types .iter() @@ -63,17 +55,6 @@ impl MetaService { }) .collect(); - // Filter out unsupported plugins - let original_len = meta_plugins.len(); - let meta_plugins: Vec> = meta_plugins - .into_iter() - .filter(|meta_plugin| meta_plugin.is_supported()) - .collect(); - - if meta_plugins.len() < original_len { - log::warn!("META_SERVICE: Some meta plugins are enabled but not supported on this system"); - } - meta_plugins } diff --git a/src/services/status_service.rs b/src/services/status_service.rs index 2c61d13..906d07f 100644 --- a/src/services/status_service.rs +++ b/src/services/status_service.rs @@ -21,14 +21,9 @@ impl StatusService { data_path: PathBuf, db_path: PathBuf, ) -> StatusInfo { - // Determine which meta plugins would be enabled for a save operation - let mut meta_plugin_types: Vec = crate::modes::common::settings_meta_plugin_types(cmd, settings); + // Get meta plugins directly from config + let meta_plugin_types: Vec = crate::modes::common::settings_meta_plugin_types(cmd, settings); - // Always add the Digest plugin if not present - if !meta_plugin_types.contains(&MetaPluginType::Digest) { - meta_plugin_types.push(MetaPluginType::Digest); - } - // Determine which compression type would be enabled for a save operation let enabled_compression_type = if let Some(compression_name) = &settings.compression() { CompressionType::from_str(compression_name).ok() @@ -44,29 +39,6 @@ impl StatusService { status_info } - pub fn generate_supported_status( - &self, - data_path: PathBuf, - db_path: PathBuf, - ) -> StatusInfo { - // Get all meta plugin types that are supported - let supported_meta_plugins: Vec = MetaPluginType::iter() - .filter(|mpt| { - let plugin = crate::meta_plugin::get_meta_plugin((*mpt).clone(), None, None); - plugin.is_supported() - }) - .collect(); - - // Default to LZ4 compression for the API status endpoint - let enabled_compression_type = Some(CompressionType::LZ4); - - let mut status_info = generate_status_info(data_path, db_path, &supported_meta_plugins, enabled_compression_type); - - // The options are now populated directly in generate_status_info - // No need to modify them here - - status_info - } } impl Default for StatusService {