diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-09-08 16:27:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-08 08:27:50 -0700 |
commit | 6c6a76b193edfd8bd46139b85fefd684ee557a8c (patch) | |
tree | b5b0efddb02ded2d8cbd80bdae049a102a20e19f /src/state/queries | |
parent | 95aee146b63f53e1cc8c686ef28dc7059b2d557f (diff) | |
download | voidsky-6c6a76b193edfd8bd46139b85fefd684ee557a8c.tar.zst |
[Video] Upload tweaks (#5228)
* use correct mime type * fix wheel progress
Diffstat (limited to 'src/state/queries')
-rw-r--r-- | src/state/queries/video/util.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/state/queries/video/util.ts b/src/state/queries/video/util.ts index 7ea38d8dc..2c1298ab6 100644 --- a/src/state/queries/video/util.ts +++ b/src/state/queries/video/util.ts @@ -39,3 +39,18 @@ export function mimeToExt(mimeType: SupportedMimeTypes | (string & {})) { throw new Error(`Unsupported mime type: ${mimeType}`) } } + +export function extToMime(ext: string) { + switch (ext) { + case 'mp4': + return 'video/mp4' + case 'webm': + return 'video/webm' + case 'mpeg': + return 'video/mpeg' + case 'mov': + return 'video/quicktime' + default: + throw new Error(`Unsupported file extension: ${ext}`) + } +} |