web: add local processing setting & api type
response is not handled at all yet, this is a raw draft
This commit is contained in:
@@ -66,6 +66,7 @@ const request = async (url: string) => {
|
||||
tiktokH265: getSetting("save", "tiktokH265"),
|
||||
|
||||
alwaysProxy: getSetting("privacy", "alwaysProxy"),
|
||||
localProcessing: getSetting("advanced", "localProcessing"),
|
||||
}
|
||||
|
||||
await getServerInfo();
|
||||
|
||||
@@ -5,7 +5,7 @@ const defaultSettings: CobaltSettings = {
|
||||
schemaVersion: 5,
|
||||
advanced: {
|
||||
debug: false,
|
||||
duck: false,
|
||||
localProcessing: false,
|
||||
},
|
||||
appearance: {
|
||||
theme: "auto",
|
||||
|
||||
@@ -3,6 +3,7 @@ enum CobaltResponseType {
|
||||
Picker = 'picker',
|
||||
Redirect = 'redirect',
|
||||
Tunnel = 'tunnel',
|
||||
LocalProcessing = 'local-processing',
|
||||
}
|
||||
|
||||
export type CobaltErrorResponse = {
|
||||
@@ -40,6 +41,33 @@ type CobaltTunnelResponse = {
|
||||
status: CobaltResponseType.Tunnel,
|
||||
} & CobaltPartialURLResponse;
|
||||
|
||||
type CobaltLocalProcessingResponse = {
|
||||
status: CobaltResponseType.LocalProcessing,
|
||||
tunnel: string[],
|
||||
|
||||
// TODO: proper type for processing types
|
||||
type: string,
|
||||
service: string,
|
||||
filename?: string,
|
||||
|
||||
metadata?: {
|
||||
album?: string,
|
||||
copyright?: string,
|
||||
title?: string,
|
||||
artist?: string,
|
||||
track?: string,
|
||||
date?: string
|
||||
},
|
||||
|
||||
audio?: {
|
||||
copy: boolean,
|
||||
format: string,
|
||||
bitrate: string,
|
||||
},
|
||||
|
||||
isHLS?: boolean,
|
||||
}
|
||||
|
||||
export type CobaltFileUrlType = "redirect" | "tunnel";
|
||||
|
||||
export type CobaltSession = {
|
||||
@@ -69,4 +97,5 @@ export type CobaltServerInfoResponse = CobaltServerInfo | CobaltErrorResponse;
|
||||
export type CobaltAPIResponse = CobaltErrorResponse
|
||||
| CobaltPickerResponse
|
||||
| CobaltRedirectResponse
|
||||
| CobaltTunnelResponse;
|
||||
| CobaltTunnelResponse
|
||||
| CobaltLocalProcessingResponse;
|
||||
|
||||
@@ -3,6 +3,6 @@ import { type CobaltSettingsV4 } from "$lib/types/settings/v4";
|
||||
export type CobaltSettingsV5 = Omit<CobaltSettingsV4, 'schemaVersion' | 'advanced'> & {
|
||||
schemaVersion: 5,
|
||||
advanced: CobaltSettingsV4['advanced'] & {
|
||||
duck: boolean;
|
||||
localProcessing: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user