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
|
|
@ -10,3 +10,16 @@ export const normalizeFiletype = (filetype: string): string => {
|
||||||
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}`;
|
||||||
|
|
||||||
|
|
@ -855,21 +856,22 @@ const app = new Elysia()
|
||||||
{Object.entries(getAllTargets()).map(([converter, targets]) => {
|
{Object.entries(getAllTargets()).map(([converter, targets]) => {
|
||||||
const inputs = getAllInputs(converter);
|
const inputs = getAllInputs(converter);
|
||||||
return (
|
return (
|
||||||
<tr key={converter}>
|
// biome-ignore lint/correctness/useJsxKeyInIterable: <explanation>
|
||||||
|
<tr>
|
||||||
<td>{converter}</td>
|
<td>{converter}</td>
|
||||||
<td>
|
<td>
|
||||||
Count: {inputs.length}
|
Count: {inputs.length}
|
||||||
<ul>
|
<ul>
|
||||||
{inputs.map((input, index) => (
|
{inputs.map((input) => (
|
||||||
<li key={index}>{input}</li>
|
<li>{input}</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
Count: {targets.length}
|
Count: {targets.length}
|
||||||
<ul>
|
<ul>
|
||||||
{targets.map((target, index) => (
|
{targets.map((target) => (
|
||||||
<li key={index}>{target}</li>
|
<li>{target}</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue