mirror of https://github.com/VERT-sh/VERT.git
feat: add file convert stats
i think this is right? counts how many files converted (and the type)
This commit is contained in:
parent
c89e38f90c
commit
14517acdfd
|
@ -79,6 +79,11 @@ export class FFmpegConverter extends Converter {
|
||||||
["converters", this.name],
|
["converters", this.name],
|
||||||
`read ${input.name.split(".").slice(0, -1).join(".") + to} from ffmpeg virtual fs`,
|
`read ${input.name.split(".").slice(0, -1).join(".") + to} from ffmpeg virtual fs`,
|
||||||
);
|
);
|
||||||
|
window.plausible("convert", {
|
||||||
|
props: {
|
||||||
|
type: "audio",
|
||||||
|
}
|
||||||
|
});
|
||||||
ffmpeg.terminate();
|
ffmpeg.terminate();
|
||||||
return new VertFile(new File([output], input.name), to);
|
return new VertFile(new File([output], input.name), to);
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,6 +178,11 @@ export class VertdConverter extends Converter {
|
||||||
ws.close();
|
ws.close();
|
||||||
const url = `${apiUrl}/api/download/${msg.data.jobId}/${uploadRes.auth}`;
|
const url = `${apiUrl}/api/download/${msg.data.jobId}/${uploadRes.auth}`;
|
||||||
this.log(`downloading from ${url}`);
|
this.log(`downloading from ${url}`);
|
||||||
|
window.plausible("convert", {
|
||||||
|
props: {
|
||||||
|
type: "video",
|
||||||
|
}
|
||||||
|
});
|
||||||
const res = await fetch(url).then((res) => res.blob());
|
const res = await fetch(url).then((res) => res.blob());
|
||||||
resolve(
|
resolve(
|
||||||
new VertFile(
|
new VertFile(
|
||||||
|
|
|
@ -74,6 +74,11 @@ export class VipsConverter extends Converter {
|
||||||
|
|
||||||
if (res.type === "finished") {
|
if (res.type === "finished") {
|
||||||
log(["converters", this.name], `converted ${input.name} to ${to}`);
|
log(["converters", this.name], `converted ${input.name} to ${to}`);
|
||||||
|
window.plausible("convert", {
|
||||||
|
props: {
|
||||||
|
type: "image",
|
||||||
|
}
|
||||||
|
});
|
||||||
return new VertFile(
|
return new VertFile(
|
||||||
new File([res.output as unknown as BlobPart], input.name),
|
new File([res.output as unknown as BlobPart], input.name),
|
||||||
to,
|
to,
|
||||||
|
|
Loading…
Reference in New Issue