Skip to content

Commit 59b6f27

Browse files
Merge pull request #3 from Traverse-Research/jasper-bekkers/worker-logging
Fix WebDAV upload path - use filename only
2 parents 2dc59b1 + 1553f05 commit 59b6f27

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/jobs.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,16 @@ async fn process_job(job: Job) -> Result<()> {
326326
info!("Creating WebDAV client...");
327327
let dav_client = WebDavClient::new(&job.webdav_config)?;
328328

329-
info!("Uploading processed video to: {}", job.output_path);
330-
match dav_client.upload_file(&job.output_path, output_data).await {
329+
// Extract just the filename from the full path for upload
330+
// output_path is like /remote.php/dav/files/jasper/VideoTest/test-2s_processed.mp4
331+
// We need just the filename: test-2s_processed.mp4
332+
let upload_filename = job.output_path
333+
.rsplit('/')
334+
.next()
335+
.unwrap_or(&job.output_path);
336+
337+
info!("Uploading processed video as: {} (from path: {})", upload_filename, job.output_path);
338+
match dav_client.upload_file(upload_filename, output_data).await {
331339
Ok(_) => info!("Upload successful!"),
332340
Err(e) => error!("Upload FAILED: {}", e),
333341
}

0 commit comments

Comments
 (0)