feat: refresh libraries after STRM updates

This commit is contained in:
ShukeBta
2026-07-02 23:20:08 +08:00
parent 2df7c34cf7
commit e700962f2a
14 changed files with 301 additions and 10 deletions
+17
View File
@@ -8,6 +8,7 @@ export type GenerateSTRMInput = {
overwrite?: boolean
include_local?: boolean
preserve_tree?: boolean
refresh_library?: boolean
}
export type GenerateSTRMResult = {
@@ -24,6 +25,7 @@ export type GenerateSTRMResult = {
previewed?: number
errors?: string[]
ignored_items?: string[]
refresh?: STRMRefreshResult
items?: Array<{
media_id: string
title: string
@@ -47,12 +49,14 @@ export type GenerateSTRMTreeInput = {
dry_run?: boolean
batch_limit?: number
transfer_subtitles?: boolean
refresh_library?: boolean
}
export type RepairSTRMInput = {
output_dir: string
base_url?: string
dry_run?: boolean
refresh_library?: boolean
}
export type RepairSTRMResult = {
@@ -61,6 +65,7 @@ export type RepairSTRMResult = {
previewed?: number
skipped: number
errors?: string[]
refresh?: STRMRefreshResult
items?: Array<{
file_path: string
before?: string
@@ -70,6 +75,18 @@ export type RepairSTRMResult = {
}>
}
export type STRMRefreshResult = {
requested: boolean
queued: boolean
reason?: string
targets?: Array<{
library_id: string
root_id?: string
name: string
path: string
}>
}
export const strmAPI = {
set: (mediaID: string, url: string) =>
api.put(`/media/${mediaID}/strm`, { url }).then((r) => r.data),