mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-29 22:14:26 +02:00
web/queue: use the updated local processing api response
& finally remove mime from the web build
This commit is contained in:
parent
e497ea51f1
commit
9eb342e6d2
@ -1,5 +1,3 @@
|
||||
import mime from "mime";
|
||||
|
||||
import { addItem } from "$lib/state/queen-bee/queue";
|
||||
import { openQueuePopover } from "$lib/state/queue-visibility";
|
||||
|
||||
@ -55,6 +53,9 @@ export const createRemuxPipeline = (file: File) => {
|
||||
}
|
||||
|
||||
export const createSavePipeline = (info: CobaltLocalProcessingResponse, request: CobaltSaveRequestBody) => {
|
||||
// TODO: proper error here
|
||||
if (!(info.output?.filename && info.output?.type)) return;
|
||||
|
||||
const parentId = crypto.randomUUID();
|
||||
const pipeline: CobaltPipelineItem[] = [];
|
||||
|
||||
@ -82,9 +83,8 @@ export const createSavePipeline = (info: CobaltLocalProcessingResponse, request:
|
||||
"-c:a", "copy"
|
||||
],
|
||||
output: {
|
||||
// TODO: return mime type from api to avoid dragging a big ass package into web build
|
||||
type: mime.getType(info.filename) || undefined,
|
||||
format: info.filename.split(".").pop(),
|
||||
type: info.output.type,
|
||||
format: info.output.filename.split(".").pop(),
|
||||
},
|
||||
},
|
||||
});
|
||||
@ -95,8 +95,8 @@ export const createSavePipeline = (info: CobaltLocalProcessingResponse, request:
|
||||
pipeline,
|
||||
canRetry: true,
|
||||
originalRequest: request,
|
||||
filename: info.filename,
|
||||
mimeType: mime.getType(info.filename) || undefined,
|
||||
filename: info.output.filename,
|
||||
mimeType: info.output.type,
|
||||
mediaType: "video",
|
||||
});
|
||||
|
||||
|
@ -45,20 +45,23 @@ type CobaltTunnelResponse = {
|
||||
|
||||
export type CobaltLocalProcessingResponse = {
|
||||
status: CobaltResponseType.LocalProcessing,
|
||||
tunnel: string[],
|
||||
|
||||
// TODO: proper type for processing types
|
||||
type: string,
|
||||
service: string,
|
||||
filename: string,
|
||||
tunnel: string[],
|
||||
|
||||
metadata?: {
|
||||
album?: string,
|
||||
copyright?: string,
|
||||
title?: string,
|
||||
artist?: string,
|
||||
track?: string,
|
||||
date?: string
|
||||
output?: {
|
||||
type?: string, // mimetype
|
||||
filename?: string,
|
||||
metadata?: {
|
||||
album?: string,
|
||||
copyright?: string,
|
||||
title?: string,
|
||||
artist?: string,
|
||||
track?: string,
|
||||
date?: string
|
||||
},
|
||||
},
|
||||
|
||||
audio?: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user