improve upload progress indicator

This commit is contained in:
2023-09-10 20:11:22 +10:00
parent 4ad0df2c39
commit 47ea87b614

View File

@@ -921,17 +921,17 @@ const computedUploadProgress = computed(() => {
return 100;
}
const totalProgress = items.reduce((accumulator, item) => {
if (item.jobs.length > 0) {
accumulator +=
Math.floor(
(item.jobs[0].progress / item.jobs[0].progress_max) * 100,
) || 100;
}
return accumulator;
}, 0);
let bytes = 0;
let maxBytes = 0;
return Math.floor(totalProgress / items.length);
items.forEach((item) => {
if (item.jobs.length > 0) {
bytes += item.jobs[0].progress;
maxBytes += item.jobs[0].progress_max;
}
});
return Math.floor((bytes / maxBytes) * 100);
});
const getProcessingMediaItems = (): Media[] => {