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 { addItem } from "$lib/state/queen-bee/queue";
|
||||||
import { openQueuePopover } from "$lib/state/queue-visibility";
|
import { openQueuePopover } from "$lib/state/queue-visibility";
|
||||||
|
|
||||||
@ -55,6 +53,9 @@ export const createRemuxPipeline = (file: File) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const createSavePipeline = (info: CobaltLocalProcessingResponse, request: CobaltSaveRequestBody) => {
|
export const createSavePipeline = (info: CobaltLocalProcessingResponse, request: CobaltSaveRequestBody) => {
|
||||||
|
// TODO: proper error here
|
||||||
|
if (!(info.output?.filename && info.output?.type)) return;
|
||||||
|
|
||||||
const parentId = crypto.randomUUID();
|
const parentId = crypto.randomUUID();
|
||||||
const pipeline: CobaltPipelineItem[] = [];
|
const pipeline: CobaltPipelineItem[] = [];
|
||||||
|
|
||||||
@ -82,9 +83,8 @@ export const createSavePipeline = (info: CobaltLocalProcessingResponse, request:
|
|||||||
"-c:a", "copy"
|
"-c:a", "copy"
|
||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
// TODO: return mime type from api to avoid dragging a big ass package into web build
|
type: info.output.type,
|
||||||
type: mime.getType(info.filename) || undefined,
|
format: info.output.filename.split(".").pop(),
|
||||||
format: info.filename.split(".").pop(),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -95,8 +95,8 @@ export const createSavePipeline = (info: CobaltLocalProcessingResponse, request:
|
|||||||
pipeline,
|
pipeline,
|
||||||
canRetry: true,
|
canRetry: true,
|
||||||
originalRequest: request,
|
originalRequest: request,
|
||||||
filename: info.filename,
|
filename: info.output.filename,
|
||||||
mimeType: mime.getType(info.filename) || undefined,
|
mimeType: info.output.type,
|
||||||
mediaType: "video",
|
mediaType: "video",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -45,13 +45,15 @@ type CobaltTunnelResponse = {
|
|||||||
|
|
||||||
export type CobaltLocalProcessingResponse = {
|
export type CobaltLocalProcessingResponse = {
|
||||||
status: CobaltResponseType.LocalProcessing,
|
status: CobaltResponseType.LocalProcessing,
|
||||||
tunnel: string[],
|
|
||||||
|
|
||||||
// TODO: proper type for processing types
|
// TODO: proper type for processing types
|
||||||
type: string,
|
type: string,
|
||||||
service: string,
|
service: string,
|
||||||
filename: string,
|
tunnel: string[],
|
||||||
|
|
||||||
|
output?: {
|
||||||
|
type?: string, // mimetype
|
||||||
|
filename?: string,
|
||||||
metadata?: {
|
metadata?: {
|
||||||
album?: string,
|
album?: string,
|
||||||
copyright?: string,
|
copyright?: string,
|
||||||
@ -60,6 +62,7 @@ export type CobaltLocalProcessingResponse = {
|
|||||||
track?: string,
|
track?: string,
|
||||||
date?: string
|
date?: string
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
audio?: {
|
audio?: {
|
||||||
copy: boolean,
|
copy: boolean,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user