fix: Fix COMPRESSION typo, correct DIGEST log tag, and refactor mode_update cloning
This commit is contained in:
committed by
Andrew Phillips (aider)
parent
eaeb83f12e
commit
e7496b8978
@@ -39,18 +39,16 @@ pub fn mode_update(
|
||||
db::set_item_tags(conn, item.clone(), tags)?;
|
||||
}
|
||||
|
||||
let item_path = {
|
||||
let mut path = data_path.clone();
|
||||
path.push(item.id.unwrap().to_string());
|
||||
path
|
||||
};
|
||||
|
||||
if item.size.is_none() {
|
||||
info!("Updating unknown stream size");
|
||||
let item_path = {
|
||||
let mut path = data_path.clone();
|
||||
path.push(item.id.unwrap().to_string());
|
||||
path
|
||||
};
|
||||
let item_file_metadata = item_path.metadata();
|
||||
|
||||
// Ensure item_path is in scope for later use
|
||||
let item_path_clone = item_path.clone();
|
||||
|
||||
if item_file_metadata.is_ok() {
|
||||
debug!("MAIN: Updating stream size of {:?}", item_path);
|
||||
let compression_type = CompressionType::from_str(&item.compression)?;
|
||||
@@ -80,7 +78,7 @@ pub fn mode_update(
|
||||
let compression_engine = get_compression_engine(compression_type)
|
||||
.expect("Unable to get compression engine");
|
||||
|
||||
let mut reader = compression_engine.open(item_path_clone)?;
|
||||
let mut reader = compression_engine.open(item_path.clone())?;
|
||||
let mut buffer = [0; 4096];
|
||||
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user