fix: 移除课程门数上限,避免与每日积分目标冲突

maxCourses 按整门课计数,而积分按课时计;只剩考试的课会白占名额,
曾出现 5 门用光但今日视频积分只拿到 1/3 就停止的情况。现在只由
今日积分完成、没有可学内容或 budgetMinutes 决定收尾。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
voidandClaude Sonnet 4.6 committed 2026-11-02 19:36:57 +08:00
1 parent 0eb4c40629
commit f41fc72fe2
20 files changed
+45 -106

No files matched your search

+3 -4
View File
@@ -41,7 +41,6 @@ export async function runSupervisor(o) {
else if (typeof stop.request === 'function') stop.request(reason);
},
});
tui.set({ maxCourses: cfg.MAX_COURSES });
log('=== 云学堂助手 · 无头运行器' + (cfg.CHECK_ONLY ? '(自检)' : '') + ' 启动 ===');
log('Node ' + process.version + ' ' + platformName + '/' + process.arch);
@@ -102,8 +101,8 @@ export async function runSupervisor(o) {
// 只在最终收尾推就等于永远不推。重复结论由 notify() 的识别键挡掉。
tui.set({ phase: '发送 Bark 通知', tone: 'info' });
await notify(finishResult(last));
// 正常结束:只有「脚本自己停了 / 无进展」且配了重启间隔才再来一轮
const restartable = !last.limitReached && cfg.RESTART_MINUTES > 0;
// 正常结束:配了重启间隔就再来一轮
const restartable = cfg.RESTART_MINUTES > 0;
if (!restartable) break;
log('按 YUN_XUE_TANG_RESTART_MINUTES=' + cfg.RESTART_MINUTES + ' 等待后重新开始…');
tui.set({ phase: '等待 ' + cfg.RESTART_MINUTES + ' 分钟后重开', tone: 'ok' });
@@ -134,7 +133,7 @@ export async function runSupervisor(o) {
const stalled = !!(last && /没有任何进展/.test(last.finishReason || ''));
const exitCode = cfg.CHECK_ONLY ? (last && last.ok ? 0 : 1) : (stalled ? 1 : 0);
// 0 = 正常收尾(达到上限 / 预算 / 无更多课程);1 = 无进展卡死;3 = 连续登录失败
// 0 = 正常收尾(预算 / 积分完成 / 无更多课程);1 = 无进展卡死;3 = 连续登录失败
const phase = cfg.CHECK_ONLY
? (exitCode === 0 ? '自检通过' : '自检失败')
: stalled ? '退出:长时间无进展' : '正常收尾';