feat: add STRM repair workflow

This commit is contained in:
ShukeBta
2026-07-02 23:01:36 +08:00
parent e7d988ebf8
commit 2df7c34cf7
9 changed files with 428 additions and 0 deletions
+25
View File
@@ -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),
}