feat: add STRM output directory presets

This commit is contained in:
ShukeBta
2026-07-03 00:53:49 +08:00
parent 862443dda6
commit a6f2d0208d
12 changed files with 271 additions and 14 deletions
+4
View File
@@ -1,6 +1,7 @@
import { useEffect, useState } from 'react'
import { libraryAPI } from '../api/library'
import { strmAPI, type STRMOutputPreset } from '../api/strm'
import type { Library } from '../types'
import { useStrmAttachForm } from './useStrmAttachForm'
import { useStrmGenerateForm } from './useStrmGenerateForm'
@@ -10,6 +11,7 @@ import { useStrmTreeGenerateForm } from './useStrmTreeGenerateForm'
export function useStrmPage() {
const [libraries, setLibraries] = useState<Library[]>([])
const [outputPresets, setOutputPresets] = useState<STRMOutputPreset[]>([])
const generate = useStrmGenerateForm(libraries)
const treeGenerate = useStrmTreeGenerateForm()
const repair = useStrmRepairForm()
@@ -18,6 +20,7 @@ export function useStrmPage() {
useEffect(() => {
libraryAPI.list().then(setLibraries).catch(() => undefined)
strmAPI.outputPresets().then(setOutputPresets).catch(() => undefined)
}, [])
return {
@@ -25,6 +28,7 @@ export function useStrmPage() {
generate,
importForm,
libraries,
outputPresets,
repair,
treeGenerate,
}