fixing sync on new podcast
This commit is contained in:
@@ -67,7 +67,7 @@ impl<'a> Playlist<'a> {
|
|||||||
|
|
||||||
drop(writer);
|
drop(writer);
|
||||||
let output = output.into_inner()?;
|
let output = output.into_inner()?;
|
||||||
if fs::read(&path)? != output {
|
if !path.exists() || fs::read(&path)? != output {
|
||||||
fs::write(path, output.as_slice())?;
|
fs::write(path, output.as_slice())?;
|
||||||
Ok(true)
|
Ok(true)
|
||||||
} else {
|
} else {
|
||||||
|
@@ -162,6 +162,7 @@ pub(crate) fn sync(
|
|||||||
|
|
||||||
if !target.exists() {
|
if !target.exists() {
|
||||||
println!("[info] copying from {:?} to {:?}.", source, target);
|
println!("[info] copying from {:?} to {:?}.", source, target);
|
||||||
|
fs::create_dir_all(target.parent().unwrap())?;
|
||||||
fs::copy(source, target)?;
|
fs::copy(source, target)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user