Commit Graph

7 Commits

Author SHA1 Message Date
yw1573 a0ef988bd5 fix: resolve critical issues and improve task management
- Fix path traversal vulnerability in downloadVideo handler by adding
  download directory whitelist validation
- Add graceful shutdown with signal handling for task persistence
- Fix division by zero panic in progressBar.percent() when total <= 0
- Add GetDB() function that returns error instead of using log.Fatal
- Change deleteTask to only remove database records, preserve downloaded files
- Add paused status for interrupted tasks on shutdown

Co-Authored-By: Claude
2026-04-09 16:51:22 +08:00
yw1573 86caa5765d feat: create season subdirectory when downloading season
下载合集时创建以合集标题命名的子目录:
- 前端 TaskInitData 增加 seasonTitle 字段
- 前端下载时传递合集 seasonTitle
- 后端 TaskInitOption 增加 SeasonTitle 字段
- 后端创建任务时根据 seasonTitle 创建子目录

Co-Authored-By: AI
2026-04-09 11:46:32 +08:00
yw1573 60b8a98a74 fix: cleanup temp files when task is cancelled
任务取消时清理临时文件(.audio/.video),避免残留

Co-Authored-By: AI
2026-04-09 11:20:14 +08:00
yw1573 9b73ea9b68 feat: add structured logging system for Docker deployment
添加日志系统,支持 Docker logs 捕获:
- 新增 logger 模块,提供 Info/Warn/Error/Debug 等日志级别
- 任务生命周期日志:创建、开始、完成、失败、取消
- 用户登录/登出日志
- 服务启动和 FFmpeg 状态日志
- 数据库初始化日志

日志格式:[时间] [级别] 消息,便于 Docker logs 查看

Co-Authored-By: AI
2026-04-09 11:02:33 +08:00
yw1573 81df437b2c feat: add task cancellation support
- Add CancelTask function to cancel running/waiting tasks
- Add /api/cancelTask endpoint
- Add cancel button in task list for running/waiting tasks
- Check cancellation status during download and merge operations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 16:40:27 +08:00
yw1573 ca6d6db708 fix: create download directory before starting task
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 15:30:53 +08:00
yw1573 dd8eaef97d refactor: restructure project to standard Go layout
- Reorganize code into cmd/bilidown and internal/ packages
- Rename client/ to web/ for frontend source
- Remove systray dependency for headless web service
- Embed static files into binary using go:embed
- Update import paths to use internal/ prefix
- Update .gitignore with common patterns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 17:21:49 +08:00