Skip to content

Commit f2aa0c0

Browse files
nit
1 parent 1ac9eec commit f2aa0c0

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

apps/desktop/src-tauri/src/upload.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,7 @@ impl UploadProgressUpdater {
217217
}
218218

219219
async fn send_api_update(app: &AppHandle, video_id: String, uploaded: u64, total: u64) {
220-
debug!(
221-
"Sending progress update to API: {}/{} bytes for video {}",
222-
uploaded, total, video_id
223-
);
220+
debug!("\tUploadProgressUpdater::send_api_update({video_id}, {uploaded}, {total})");
224221

225222
let response = app
226223
.authed_api_request("/api/desktop/video/progress", |client, url| {
@@ -725,19 +722,6 @@ impl InstantMultipartUpload {
725722
let mut last_uploaded_position: u64 = 0;
726723
let mut progress = UploadProgressUpdater::new(app.clone(), pre_created_video.id.clone());
727724

728-
// Initialize progress with proper values
729-
if let Ok(metadata) = tokio::fs::metadata(&file_path).await {
730-
let initial_file_size = metadata.len();
731-
debug!("Initial file size: {} bytes", initial_file_size);
732-
if initial_file_size > 0 {
733-
progress.update(0, initial_file_size);
734-
} else {
735-
debug!("Initial file size is 0, will wait for file to grow");
736-
}
737-
} else {
738-
warn!("Could not get initial file metadata for progress tracking");
739-
}
740-
741725
// --------------------------------------------
742726
// initiate the multipart upload
743727
// --------------------------------------------
@@ -951,6 +935,7 @@ impl InstantMultipartUpload {
951935
let remaining = file_size - *last_uploaded_position;
952936
let bytes_to_read = std::cmp::min(chunk_size, remaining);
953937

938+
// TODO: Surely we can reuse this
954939
let mut file = tokio::fs::File::open(file_path)
955940
.await
956941
.map_err(|e| format!("Failed to open file: {e}"))?;
@@ -1010,6 +995,7 @@ impl InstantMultipartUpload {
1010995
);
1011996
}
1012997

998+
// TODO: Shouldn't this be inferable?
1013999
let file_size = tokio::fs::metadata(file_path)
10141000
.await
10151001
.map(|m| m.len())

packages/web-backend/src/Videos/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Array, Effect, Option, pipe } from "effect";
55

66
import { Database } from "../Database.ts";
77
import { S3Buckets } from "../S3Buckets/index.ts";
8-
import { S3BucketAccess } from "../S3Buckets/S3BucketAccess.ts";
98
import { VideosPolicy } from "./VideosPolicy.ts";
109
import { VideosRepo } from "./VideosRepo.ts";
1110

0 commit comments

Comments
 (0)