mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-30 03:36:37 +08:00
feat: add STRM repair workflow
This commit is contained in:
@@ -49,6 +49,27 @@ export type GenerateSTRMTreeInput = {
|
||||
transfer_subtitles?: boolean
|
||||
}
|
||||
|
||||
export type RepairSTRMInput = {
|
||||
output_dir: string
|
||||
base_url?: string
|
||||
dry_run?: boolean
|
||||
}
|
||||
|
||||
export type RepairSTRMResult = {
|
||||
output_dir: string
|
||||
repaired: number
|
||||
previewed?: number
|
||||
skipped: number
|
||||
errors?: string[]
|
||||
items?: Array<{
|
||||
file_path: string
|
||||
before?: string
|
||||
after?: string
|
||||
action: string
|
||||
reason?: string
|
||||
}>
|
||||
}
|
||||
|
||||
export const strmAPI = {
|
||||
set: (mediaID: string, url: string) =>
|
||||
api.put(`/media/${mediaID}/strm`, { url }).then((r) => r.data),
|
||||
@@ -63,4 +84,8 @@ export const strmAPI = {
|
||||
api
|
||||
.post<GenerateSTRMResult>('/strm/generate-from-tree', input, { timeout: BATCH_REQUEST_TIMEOUT })
|
||||
.then((r) => r.data),
|
||||
repair: (input: RepairSTRMInput) =>
|
||||
api
|
||||
.post<RepairSTRMResult>('/strm/repair', input, { timeout: BATCH_REQUEST_TIMEOUT })
|
||||
.then((r) => r.data),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user