()
| 340 | } |
| 341 | |
| 342 | async doVideo() { |
| 343 | if (!this.videoTask) return ["未找到视频任务"]; |
| 344 | const total = Number(this.videoTask.activity?.cycle_quota || 0); |
| 345 | const progress = Number(this.videoTask.progress || 0); |
| 346 | const remaining = Math.max(0, total - progress); |
| 347 | if (!remaining) return ["视频任务今日已完成"]; |
| 348 | |
| 349 | const limit = Number(process.env.mimeng_video_times || remaining); |
| 350 | const times = Math.max(0, Math.min(remaining, Number.isFinite(limit) ? limit : remaining)); |
| 351 | const results = []; |
| 352 | for (let i = 0; i < times; i++) { |
| 353 | results.push(await this.activityPush(this.videoTask.activity.id, `视频任务[${i + 1}/${times}]`)); |
| 354 | await $.wait(1200); |
| 355 | } |
| 356 | return results; |
| 357 | } |
| 358 | |
| 359 | async run() { |
| 360 | await this.login(); |
no test coverage detected