Improved file type detection and timing output

This commit is contained in:
n1474335 2023-02-03 17:39:12 +00:00
parent 659325c85a
commit 533047a3a2
3 changed files with 43 additions and 6 deletions

View file

@ -6,7 +6,7 @@
import {showSidePanel} from "./sidePanel.mjs";
import Utils from "../../core/Utils.mjs";
import {isImage} from "../../core/lib/FileType.mjs";
import {isImage, detectFileType} from "../../core/lib/FileType.mjs";
/**
* A File Details extension for CodeMirror
@ -102,7 +102,7 @@ class FileDetailsPanel {
} else {
this.resetFileThumb();
}
fileType.textContent = type;
fileType.textContent = type ? type : detectFileType(fileBuffer)[0]?.mime ?? "unknown";
}
/**

View file

@ -254,7 +254,7 @@ class StatusBarPanel {
if (this.label === "Output" && this.timing) {
bakingTimeInfo.style.display = "inline-block";
bakingTime.textContent = this.timing.overallDuration(this.tabNumGetter());
bakingTime.textContent = this.timing.duration(this.tabNumGetter());
const info = this.timing.printStages(this.tabNumGetter()).replace(/\n/g, "<br>");
bakingTimeInfo.setAttribute("title", info);