feat: fix case-sensitivity (#28)

* feat: testing nightly webhook

* feat: add nightly label

* chore: uguhhhh debug

* fix: ??????

* fifiixxixifixiifixi

* ????

* fix: hawk a tuah behind YOU

* fix hawk tuah

* test!!

* sdfgsdgsdfg???

* oh no

* fix: conversion casing
This commit is contained in:
nullptr 2024-11-15 12:18:14 +00:00 committed by GitHub
parent 8913db38f4
commit ca6a78eaa1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 6 deletions

View File

@ -1,12 +1,16 @@
import { VertFile } from "$lib/types";
import { Converter } from "./converter.svelte";
import VipsWorker from "$lib/workers/vips?worker";
import VipsWorker from "$lib/workers/vips?worker&url";
import { browser } from "$app/environment";
import type { WorkerMessage, OmitBetterStrict } from "$lib/types";
import { log } from "$lib/logger";
export class VipsConverter extends Converter {
private worker: Worker = browser ? new VipsWorker() : null!;
private worker: Worker = browser
? new Worker(VipsWorker, {
type: "module",
})
: null!;
private id = 0;
public name = "libvips";
public ready = $state(false);
@ -35,8 +39,10 @@ export class VipsConverter extends Converter {
super();
log(["converters", this.name], `created converter`);
if (!browser) return;
log(["converters", this.name], `loading worker @ ${VipsWorker}`);
this.worker.onmessage = (e) => {
const message: WorkerMessage = e.data;
log(["converters", this.name], `received message ${message.type}`);
if (message.type === "loaded") this.ready = true;
};
}

View File

@ -34,7 +34,6 @@ export class VertFile {
}
public async convert() {
console.log(this.converter);
if (!this.converter) throw new Error("No converter found");
this.result = null;
this.progress = 0;

View File

@ -20,7 +20,7 @@
const from =
"." + f.name.toLowerCase().split(".").slice(-1);
const converter = converters.find((c) =>
c.supportedFormats.includes(from),
c.supportedFormats.includes(from.toLowerCase()),
);
if (!converter) resolve();
const to =

View File

@ -35,8 +35,8 @@
const file = files.files[i];
const converter = converters.find(
(c) =>
c.supportedFormats.includes(file.from) &&
c.supportedFormats.includes(file.to),
c.supportedFormats.includes(file.from.toLowerCase()) &&
c.supportedFormats.includes(file.to.toLowerCase()),
);
if (!converter) throw new Error("No converter found");
required.push(converter);