31 Commits

Author SHA1 Message Date
yw1573 63a7cb347b fix: cancel parse requests when modal is closed
点击取消解析时,清空 PQueue 队列并中断正在进行的请求。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 09:11:10 +08:00
yw1573 ad31301e10 perf: speed up graceful shutdown
移除关闭时等待信号量释放的逻辑,直接标记任务为暂停状态。
超时时间从 10 秒减少到 3 秒,加快进程退出速度。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 08:59:25 +08:00
yw1573 a643f185a1 feat: create subdirectory for multi-page videos
多P视频也创建子目录,子目录名称使用视频标题。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 08:44:02 +08:00
yw1573 68944da29c refactor: remove collection title from video filename
创建合集子目录后,视频文件名不再重复包含合集标题。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 08:41:56 +08:00
yw1573 6dcc4e7f52 fix: use collection title for subdirectory name
修复合集目录名称问题:
- 添加 collectionTitle 字段存储视频合集标题(ugc_season.title)
- 创建子目录时使用合集名称而非视频标题

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 08:39:25 +08:00
yw1573 60a716cb46 feat: create collection directory for video sections
当视频有多个 section(合集)时,也创建合集子目录存放下载的视频。
之前只有番剧模式(season)才会创建子目录。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 18:23:57 +08:00
yw1573 2a3dc99a7a refactor: remove showFile API for Docker compatibility
Docker 容器内无法调用宿主机文件管理器,移除 showFile 接口:
- 移除后端 showFile 路由和处理函数
- 移除前端 showFile 调用和"打开文件位置"按钮
- 移除 opening 状态和 FolderSVG 组件

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 18:11:56 +08:00
yw1573 be925abfdb perf: increase download and merge concurrency to 5
将并发下载数和合并数从 3 提升到 5,加快批量任务处理速度。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 18:05:17 +08:00
yw1573 aeaeeb13d3 fix: add missing span to van.tags destructuring
修复白屏问题:缺少 span 标签解构导致运行时错误。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 17:57:47 +08:00
yw1573 dcc6b5969e refactor: replace fake progress bar with spinner for task creation
移除批量下载时模拟的进度条,改用转圈加载动画。
模拟进度条没有实际意义,单事务创建任务速度已大幅提升。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 17:40:16 +08:00
yw1573 c8ee9685b9 perf: optimize batch task creation with single transaction
批量创建任务使用单事务数据库插入,显著提升性能。
移除任务列表的批量取消/删除进度显示(批处理接口无意义)。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 17:24:06 +08:00
yw1573 0ac6570da9 feat: add sticky progress bar for batch operations
批量下载、批量取消和批量删除操作添加固定在顶部的进度条。
使用 CSS sticky-top 确保进度条始终可见,无论滚动位置如何。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 17:14:12 +08:00
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 449b5fe3a2 feat: add download progress indicator for batch download
批量下载时显示创建下载任务的进度:
- 增加 downloadProgress 和 downloadTotal 状态
- 下载时显示进度条和计数
- 创建任务完成后自动关闭弹窗

Co-Authored-By: AI
2026-04-09 12:38:49 +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 36d089705a fix: remove duplicate timestamp in log output
禁用 log 默认时间戳,避免日志输出重复时间

Co-Authored-By: AI
2026-04-09 11:06:17 +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 04e1045c4f refactor: remove shutdown button for Docker deployment
Docker 容器化部署是长期运行的服务,移除关闭服务按钮:
- 删除前端 header.ts 中的关闭按钮
- 删除 main.go 中的 /api/shutdown 接口
- 删除 router.go 中的 quit 路由和处理函数

Co-Authored-By: AI
2026-04-09 10:46:29 +08:00
yw1573 d97c0f667d fix: use goproxy.cn for faster dependency download
Co-Authored-By: AI
2026-04-09 10:30:56 +08:00
yw1573 9366c9210e feat: add Docker deployment configuration
添加 Docker 部署支持:
- Dockerfile: 多阶段构建,包含 ffmpeg 依赖
- docker-compose.yml: 配置端口映射和持久化目录
- .dockerignore: 优化构建上下文

Co-Authored-By: AI
2026-04-09 10:26:22 +08:00
yw1573 e8f71b04ac feat(task): add batch delete and cancel API support
支持批量删除和取消任务的接口:
- deleteTask 接口支持 POST 方式传入 ids 数组
- cancelTask 接口支持 POST 方式传入 ids 数组
- 前端批量操作改为调用批量接口,减少请求数量

Co-Authored-By: AI
2026-04-07 17:38:52 +08:00
yw1573 aa59a4559f feat: add batch select and operations for task list
- Add checkbox for each task item
- Add select all checkbox in toolbar
- Add batch cancel button for selected running/waiting tasks
- Add batch delete button for selected completed/failed tasks
- Show selected count in toolbar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 17:05:48 +08:00
yw1573 8fb1aa36ca fix: increase createTask timeout to 60 seconds
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 16:50:57 +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 1b23d813a8 perf: optimize createTask by moving GetCurrentFolder outside loop
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 16:16:49 +08:00
yw1573 576b543c9b refactor: remove duplicate shutdown button from settings
Keep only one shutdown button in header, remove duplicate from settings page

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 16:02:23 +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 eb662a8b66 feat: add FFmpeg status check and shutdown button
- FFmpeg check no longer blocks server startup
- Add /api/checkFFmpeg endpoint to query FFmpeg availability
- Add /api/shutdown endpoint to gracefully stop the server
- Add FFmpeg status indicator in web header
- Add shutdown button in web interface
- Move static files output to cmd/bilidown/static for embedding
- Update .gitignore to exclude cmd/bilidown/static

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 15:27:55 +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
yw1573 4facf82956 init: git clone https://github.com/iuroc/bilidown.git 2026-04-02 15:16:34 +08:00