fix: correct critical bugs and improve pipe streaming performance
Critical bug fixes:
- save_item now returns real Item from database, not a hardcoded fake
- AsyncDataService::save() reuses self.sync_service instead of creating redundant instance
- GenerateStatus trait signature mismatch fixed (CLI/API decoupling)
Performance improvements (pipe path untouched):
- CompressionEngine::open() returns Box<dyn Read + Send> enabling true streaming
- mode_get eliminates triple full-file read (was sampling then re-reading entire file)
- FilteringReader adds fast-path bypass when no filters, pre-allocates temp buffer
- text.rs meta plugin processes &[u8] slice directly, eliminates data.to_vec() clone
API correctness:
- Tag parse errors now return 400 instead of being silently discarded
- compute_diff uses similar crate (LCS-based) instead of naive positional comparison
Cleanup:
- Modernize string formatting (format!({x})) across codebase
- Remove redundant DB query in get mode
- Derive Debug/ToSchema on public types
- Delete placeholder test files with no real assertions
- Extract parse_comma_tags utility function
This commit is contained in:
@@ -16,16 +16,13 @@ impl MetaService {
|
||||
pub fn get_plugins(&self, cmd: &mut Command, settings: &Settings) -> Vec<Box<dyn MetaPlugin>> {
|
||||
debug!("META_SERVICE: get_plugins called");
|
||||
let meta_plugin_types: Vec<MetaPluginType> = settings_meta_plugin_types(cmd, settings);
|
||||
debug!(
|
||||
"META_SERVICE: Meta plugin types from settings: {:?}",
|
||||
meta_plugin_types
|
||||
);
|
||||
debug!("META_SERVICE: Meta plugin types from settings: {meta_plugin_types:?}");
|
||||
|
||||
// Create plugins with their configuration
|
||||
let meta_plugins: Vec<Box<dyn MetaPlugin>> = meta_plugin_types
|
||||
.iter()
|
||||
.map(|meta_plugin_type| {
|
||||
debug!("META_SERVICE: Creating plugin: {:?}", meta_plugin_type);
|
||||
debug!("META_SERVICE: Creating plugin: {meta_plugin_type:?}");
|
||||
|
||||
// Get the plugin name using strum's Display implementation
|
||||
let plugin_name = meta_plugin_type.to_string();
|
||||
@@ -186,7 +183,7 @@ impl MetaService {
|
||||
value: meta_data.value,
|
||||
};
|
||||
if let Err(e) = crate::db::store_meta(conn, db_meta) {
|
||||
log::warn!("META_SERVICE: Failed to store metadata: {}", e);
|
||||
log::warn!("META_SERVICE: Failed to store metadata: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user