From 7ce0ae5830acb74ea711f8db7b1c0f097ca53d3f Mon Sep 17 00:00:00 2001 From: Aaron Manning Date: Thu, 25 Sep 2025 23:26:01 +1000 Subject: [PATCH] fixing sync on new podcast --- src/playlist.rs | 2 +- src/sync.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/playlist.rs b/src/playlist.rs index 8f42b16..b6a0876 100644 --- a/src/playlist.rs +++ b/src/playlist.rs @@ -67,7 +67,7 @@ impl<'a> Playlist<'a> { drop(writer); let output = output.into_inner()?; - if fs::read(&path)? != output { + if !path.exists() || fs::read(&path)? != output { fs::write(path, output.as_slice())?; Ok(true) } else { diff --git a/src/sync.rs b/src/sync.rs index 9bc0d83..6840b4c 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -162,6 +162,7 @@ pub(crate) fn sync( if !target.exists() { println!("[info] copying from {:?} to {:?}.", source, target); + fs::create_dir_all(target.parent().unwrap())?; fs::copy(source, target)?; } }