初始化

初始化项目
This commit is contained in:
truewhile
2026-08-23 22:12:32 +08:00
parent 0bcb1fec87
commit 71bf60c69c
631 changed files with 2121 additions and 76050 deletions
-55
View File
@@ -1,55 +0,0 @@
import { api } from './client'
import type { QBitTorrent } from '../types'
export interface ActiveTranscode {
media_id: string
encoder: string
started_at: string
playlist_ok: boolean
}
export type TaskItemStatus = 'pending' | 'running' | 'succeeded' | 'failed'
export interface TaskItem {
id: string
kind: string // organize | scan | scrape
status: TaskItemStatus
name: string
source?: string
dest_path?: string
library_id?: string
error?: string
}
export interface BackgroundTask {
id: string
kind: string
name: string
status: 'running' | 'completed' | 'failed'
stage?: string
source_path?: string
dest_path?: string
message?: string
error?: string
details?: string[]
metrics?: Record<string, number>
items?: TaskItem[]
started_at: string
updated_at: string
finished_at?: string
}
export interface BackgroundTaskSnapshot {
active: BackgroundTask[]
recent: BackgroundTask[]
}
export interface TasksSnapshot {
transcodes: ActiveTranscode[]
torrents: QBitTorrent[] | null
background_tasks?: BackgroundTaskSnapshot
}
export const tasksAPI = {
snapshot: () => api.get<TasksSnapshot>('/tasks').then((r) => r.data),
}