application/upload.c

changeset 91
7ee944cf53de
parent 90
f501f0efc9a8
child 95
e92c72705da4
--- a/application/upload.c	Wed Nov 27 13:27:30 2024 +0100
+++ b/application/upload.c	Wed Nov 27 14:06:56 2024 +0100
@@ -82,6 +82,19 @@
         ui_set(upload->label_top_right, file_label.ptr);
         free(file_label.ptr);
     }
+    
+    time_t start = upload->progress.speedtest_start;
+    time_t t = time(NULL);
+    if(t >= upload->progress.speedtest_start + 4) {
+        uint64_t bytesPerSeconds = dav_transfer_speed(&upload->progress, t);
+        if(start > 0) {
+            char *szps = util_size_str(FALSE, bytesPerSeconds);
+            cxmutstr label3 = cx_asprintf("%s/s", szps);
+            free(szps);
+            ui_set(upload->label_bottom_left, label3.ptr);
+            free(label3.ptr);
+        }
+    }
 }
 
 

mercurial