fix: Remove unsupported scdl flag and use rsync for local copy

Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
Chaos Rogers 2025-08-19 22:17:12 +01:00
parent cd3748d33f
commit 469472d289

View file

@ -84,7 +84,7 @@ fn download_media(video_url: &str, download_path: &Path, settings: &Settings) ->
} else if video_url.contains("soundcloud.com") {
println!("[INFO] Soundcloud link detected. Using scdl...");
cmd = Command::new("scdl");
cmd.args(["-l", video_url, "--no-mtime"]);
cmd.args(["-l", video_url]);
} else {
println!("[INFO] Non-Apple Music link. Using yt-dlp...");
cmd = Command::new("yt-dlp");
@ -108,11 +108,18 @@ fn transfer_files(source_path: &Path, settings: &Settings) -> Result<()> {
if !is_empty {
if settings.nas_host == "localhost" {
println!("[INFO] NAS_HOST is localhost, copying files locally...");
let mut options = fs_extra::dir::CopyOptions::new();
options.content_only = true;
fs_extra::dir::copy(source_path, &settings.nas_path, &options)
.context("Failed to copy files locally")?;
println!("[INFO] NAS_HOST is localhost, copying files locally via rsync...");
let mut rsync_cmd = Command::new("rsync");
let source = format!(
"{}/",
source_path.to_str().context("Invalid source path")?
);
rsync_cmd.args(["-r", &source, &settings.nas_path]);
let status = rsync_cmd.status().context("Failed to execute rsync")?;
if !status.success() {
anyhow::bail!("rsync failed with status: {}", status);
}
} else {
println!("[INFO] Transferring files to NAS via scp...");
let mut scp_cmd = Command::new("scp");