mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-04 12:36:37 +08:00
feat: add STRM output directory presets
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user