redid ffmpeg
This commit is contained in:
parent
16c1460620
commit
ac8f44b4c1
3 changed files with 772 additions and 625 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -9,4 +9,17 @@ export const normalizeFiletype = (filetype: string): string => {
|
||||||
default:
|
default:
|
||||||
return lowercaseFiletype;
|
return lowercaseFiletype;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const normalizeOutputFiletype = (filetype: string): string => {
|
||||||
|
const lowercaseFiletype = filetype.toLowerCase();
|
||||||
|
|
||||||
|
switch (lowercaseFiletype) {
|
||||||
|
case "jpeg":
|
||||||
|
return "jpg";
|
||||||
|
case "mpeg4":
|
||||||
|
return "mp4";
|
||||||
|
default:
|
||||||
|
return lowercaseFiletype;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -615,6 +615,7 @@ const app = new Elysia()
|
||||||
const filePath = `${userUploadsDir}${fileName}`;
|
const filePath = `${userUploadsDir}${fileName}`;
|
||||||
const fileTypeOrig = fileName.split(".").pop() as string;
|
const fileTypeOrig = fileName.split(".").pop() as string;
|
||||||
const fileType = normalizeFiletype(fileTypeOrig);
|
const fileType = normalizeFiletype(fileTypeOrig);
|
||||||
|
const newFileExt = normalizeOutputFiletype(convertTo);
|
||||||
const newFileName = fileName.replace(fileTypeOrig, convertTo);
|
const newFileName = fileName.replace(fileTypeOrig, convertTo);
|
||||||
const targetPath = `${userOutputDir}${newFileName}`;
|
const targetPath = `${userOutputDir}${newFileName}`;
|
||||||
|
|
||||||
|
|
@ -838,50 +839,51 @@ const app = new Elysia()
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseHtml title="ConvertX | Converters">
|
<BaseHtml title="ConvertX | Converters">
|
||||||
<Header loggedIn />
|
<Header loggedIn />
|
||||||
<main class="container">
|
<main class="container">
|
||||||
<article>
|
<article>
|
||||||
<h1>Converters</h1>
|
<h1>Converters</h1>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Converter</th>
|
<th>Converter</th>
|
||||||
<th>From (Count)</th>
|
<th>From (Count)</th>
|
||||||
<th>To (Count)</th>
|
<th>To (Count)</th>
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{Object.entries(getAllTargets()).map(([converter, targets]) => {
|
|
||||||
const inputs = getAllInputs(converter);
|
|
||||||
return (
|
|
||||||
<tr key={converter}>
|
|
||||||
<td>{converter}</td>
|
|
||||||
<td>
|
|
||||||
Count: {inputs.length}
|
|
||||||
<ul>
|
|
||||||
{inputs.map((input, index) => (
|
|
||||||
<li key={index}>{input}</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
Count: {targets.length}
|
|
||||||
<ul>
|
|
||||||
{targets.map((target, index) => (
|
|
||||||
<li key={index}>{target}</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
);
|
</thead>
|
||||||
})}
|
<tbody>
|
||||||
</tbody>
|
{Object.entries(getAllTargets()).map(([converter, targets]) => {
|
||||||
</table>
|
const inputs = getAllInputs(converter);
|
||||||
</article>
|
return (
|
||||||
</main>
|
// biome-ignore lint/correctness/useJsxKeyInIterable: <explanation>
|
||||||
</BaseHtml>
|
<tr>
|
||||||
);
|
<td>{converter}</td>
|
||||||
|
<td>
|
||||||
|
Count: {inputs.length}
|
||||||
|
<ul>
|
||||||
|
{inputs.map((input) => (
|
||||||
|
<li>{input}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
Count: {targets.length}
|
||||||
|
<ul>
|
||||||
|
{targets.map((target) => (
|
||||||
|
<li>{target}</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</article>
|
||||||
|
</main>
|
||||||
|
</BaseHtml>
|
||||||
|
);
|
||||||
})
|
})
|
||||||
.get(
|
.get(
|
||||||
"/zip/:userId/:jobId",
|
"/zip/:userId/:jobId",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue