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
@@ -97,7 +97,7 @@ pub trait CompressionEngine {
|
||||
loop {
|
||||
let n = reader.read(&mut buffer[..libc::BUFSIZ as usize])?;
|
||||
if n == 0 {
|
||||
debug!("COMPREESSION: EOF");
|
||||
debug!("COMPRESSION: EOF");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ impl DigestEngine for DigestEngineProgram {
|
||||
}
|
||||
|
||||
fn get_program_path(program: &str) -> Result<String> {
|
||||
debug!("COMPRESSION: Looking for executable: {}", program);
|
||||
debug!("DIGEST: Looking for executable: {}", program);
|
||||
if let Ok(path) = env::var("PATH") {
|
||||
for p in path.split(':') {
|
||||
let p_str = format!("{}/{}", p, program);
|
||||
|
||||
@@ -39,17 +39,15 @@ pub fn mode_update(
|
||||
db::set_item_tags(conn, item.clone(), tags)?;
|
||||
}
|
||||
|
||||
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.size.is_none() {
|
||||
info!("Updating unknown stream size");
|
||||
let item_file_metadata = item_path.metadata();
|
||||
|
||||
if item_file_metadata.is_ok() {
|
||||
debug!("MAIN: Updating stream size of {:?}", item_path);
|
||||
@@ -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