@@ -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 ! ( "\t UploadProgressUpdater::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 ( ) )
0 commit comments