continue fixing

This commit is contained in:
2026-08-18 21:57:25 +08:00
parent aa8baab7c0
commit 3f86e8f44e
6 changed files with 202 additions and 15 deletions

View File

@@ -258,11 +258,13 @@ async function deleteVideo(video) {
function formatDuration(ms) {
if (!ms) return "-";
const total = Math.floor(ms / 1000);
const hours = Math.floor(total / 3600);
const minutes = Math.floor(total % 3600 / 60);
const seconds = total % 60;
return hours ? `${hours}:${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}` : `${minutes}:${String(seconds).padStart(2, "0")}`;
const totalTenths = Math.floor(ms / 100);
const hours = Math.floor(totalTenths / 36000);
const minutes = Math.floor(totalTenths % 36000 / 600);
const seconds = Math.floor(totalTenths % 600 / 10);
const tenths = totalTenths % 10;
const base = `${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}.${tenths}`;
return hours ? `${hours}:${base}` : base;
}
function formatBytes(bytes) {