--- a/application/davcontroller.c Wed Nov 27 13:27:30 2024 +0100 +++ b/application/davcontroller.c Wed Nov 27 14:06:56 2024 +0100 @@ -1107,3 +1107,14 @@ void dav_resourceviewer_destroy(DavResourceViewer *res) { } + + +uint64_t dav_transfer_speed(TransferProgress *progress, time_t current) { + size_t bytes = progress->transferred_bytes - progress->speedtest_bytes; + time_t t = current - progress->speedtest_start; + + progress->speedtest_start = current; + progress->speedtest_bytes = progress->transferred_bytes; + + return bytes/t; +}