feat: add file convert stats

i think this is right? counts how many files converted (and the type)
This commit is contained in:
JovannMC 2025-02-17 22:28:49 +03:00
parent c89e38f90c
commit 14517acdfd
No known key found for this signature in database
3 changed files with 15 additions and 0 deletions

View File

@ -79,6 +79,11 @@ export class FFmpegConverter extends Converter {
["converters", this.name],
`read ${input.name.split(".").slice(0, -1).join(".") + to} from ffmpeg virtual fs`,
);
window.plausible("convert", {
props: {
type: "audio",
}
});
ffmpeg.terminate();
return new VertFile(new File([output], input.name), to);
}

View File

@ -178,6 +178,11 @@ export class VertdConverter extends Converter {
ws.close();
const url = `${apiUrl}/api/download/${msg.data.jobId}/${uploadRes.auth}`;
this.log(`downloading from ${url}`);
window.plausible("convert", {
props: {
type: "video",
}
});
const res = await fetch(url).then((res) => res.blob());
resolve(
new VertFile(

View File

@ -74,6 +74,11 @@ export class VipsConverter extends Converter {
if (res.type === "finished") {
log(["converters", this.name], `converted ${input.name} to ${to}`);
window.plausible("convert", {
props: {
type: "image",
}
});
return new VertFile(
new File([res.output as unknown as BlobPart], input.name),
to,