application/download.c

changeset 91
7ee944cf53de
parent 87
5360027fb282
child 95
e92c72705da4
--- a/application/download.c	Wed Nov 27 13:27:30 2024 +0100
+++ b/application/download.c	Wed Nov 27 14:06:56 2024 +0100
@@ -80,6 +80,18 @@
     free(sz_total);
     free(label1.ptr);
     
+    time_t start = download->progress.speedtest_start;
+    time_t t = time(NULL);
+    if(t >= download->progress.speedtest_start + 4) {
+        uint64_t bytesPerSeconds = dav_transfer_speed(&download->progress, t);
+        if(start > 0) {
+            char *szps = util_size_str(FALSE, bytesPerSeconds);
+            cxmutstr label3 = cx_asprintf("%s/s", szps);
+            free(szps);
+            ui_set(download->label_bottom_left, label3.ptr);
+            free(label3.ptr);
+        }
+    }
 
     return 1;
 }

mercurial