You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flowchart LR
Input[原始文件名] --> Clean[清理垃圾信息]
Clean --> Detect{检测格式}
Detect -->|S01E01| Standard[标准解析器]
Detect -->|第x集| Chinese[中文解析器]
Detect -->|第x話| Japanese[日文解析器]
Standard --> Extract[提取信息]
Chinese --> Extract
Japanese --> Extract
Extract --> Output[剧名 + 季号 + 集号]
Loading
任务队列流程
sequenceDiagram
participant User as 用户
participant API as API 层
participant Queue as 任务队列
participant Worker as 工作进程
participant WS as WebSocket
User->>API: 创建刮削任务
API->>Queue: 添加到队列
API-->>User: 返回任务 ID
Queue->>Worker: 分发任务
Worker->>WS: 推送进度
WS-->>User: 实时更新
Worker->>Worker: 执行刮削
Worker->>WS: 推送结果
WS-->>User: 显示结果
# 后端开发cd server
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python run_server.py --host 0.0.0.0 --port 8000
# 前端开发cd web
pnpm install
pnpm dev
🌐 API 端点
认证模块 /api/auth
方法
路径
说明
POST
/login
用户登录
POST
/logout
用户登出
POST
/register
注册账户
POST
/refresh
刷新令牌
GET
/status
认证状态
GET
/sessions
会话列表
文件模块 /api/files
方法
路径
说明
POST
/scan
扫描文件夹
GET
/browse
浏览目录
刮削模块 /api/scraper
方法
路径
说明
POST
/scrape
执行刮削
POST
/scrape-by-id
按 TMDB ID 刮削
GET
/status
刮削状态
配置模块 /api/config
方法
路径
说明
GET/PUT
/tmdb
TMDB 配置
GET/PUT
/proxy
代理设置
GET/PUT
/organize
整理配置
GET/PUT
/download
下载设置
GET/PUT
/nfo
NFO 设置
其他模块
路径
说明
/api/tmdb/*
TMDB 代理接口
/api/emby/*
Emby 集成
/api/watcher/*
文件夹监控
/api/history/*
历史记录
/api/scheduler/*
定时任务
/ws
WebSocket 实时通信
/health
健康检查
🎨 前端页面
路径
页面
功能
/
首页
统计概览、快捷入口
/login
登录
用户认证
/scan
手动任务
创建刮削任务
/history
刮削记录
查看历史记录
/files
文件管理
浏览媒体文件
/settings
设置
系统配置
/security
安全设置
账户管理
🛠️ 技术栈
后端
技术
版本
用途
Python
3.11+
运行时
FastAPI
0.109+
Web 框架
Uvicorn
0.27+
ASGI 服务器
aiosqlite
0.19+
异步 SQLite
httpx
0.27+
HTTP 客户端
watchdog
4.0+
文件监控
python-jose
3.3+
JWT 认证
Pydantic
2.6+
数据验证
前端
技术
版本
用途
Vue
3.5+
前端框架
TypeScript
5.9+
类型系统
Vite
7+
构建工具
Pinia
3.0+
状态管理
Vue Router
4.6+
路由管理
Naive UI
2.43+
UI 组件库
Axios
1.13+
HTTP 客户端
部署
技术
用途
Docker
容器化
Caddy
反向代理
SQLite
数据存储
📊 数据库设计
核心表结构
erDiagram
config {
string key PK
text value
datetime updated_at
}
admin {
int id PK
string username UK
string password_hash
datetime created_at
}
sessions {
string id PK
int user_id FK
string token
datetime expires_at
datetime created_at
}
history_records {
string id PK
string file_path
string status
string tmdb_id
json details
datetime created_at
}
scraped_files {
string id PK
string source_path
string target_path
int file_size
int tmdb_id
int season
int episode
datetime scraped_at
}
manual_jobs {
int id PK
string name
string source_dir
string output_dir
string status
datetime created_at
}
scrape_jobs {
string id PK
string file_path
string status
int source_id FK
datetime created_at
}
watched_folders {
int id PK
string path
string output_dir
bool enabled
datetime created_at
}
admin ||--o{ sessions : has
manual_jobs ||--o{ scrape_jobs : contains
scrape_jobs ||--o| history_records : creates
history_records ||--o| scraped_files : records