tronclass-auto 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/tui.js +8 -14
package/package.json
CHANGED
package/src/tui.js
CHANGED
|
@@ -70,19 +70,13 @@ async function runMenu(config) {
|
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const { selectedCourses } = await inquirer.prompt([{
|
|
80
|
-
type: 'checkbox',
|
|
81
|
-
name: 'selectedCourses',
|
|
82
|
-
message: '選擇要觀看的課程:',
|
|
83
|
-
choices: courseChoices,
|
|
84
|
-
validate: (ans) => ans.length > 0 ? true : '至少選一個課程'
|
|
73
|
+
const { confirm } = await inquirer.prompt([{
|
|
74
|
+
type: 'confirm',
|
|
75
|
+
name: 'confirm',
|
|
76
|
+
message: `開始觀看全部 ${config.courses.length} 個課程?`,
|
|
77
|
+
default: true
|
|
85
78
|
}]);
|
|
79
|
+
if (!confirm) return;
|
|
86
80
|
|
|
87
81
|
const { headless } = await inquirer.prompt([{
|
|
88
82
|
type: 'confirm',
|
|
@@ -94,14 +88,14 @@ async function runMenu(config) {
|
|
|
94
88
|
console.log('');
|
|
95
89
|
box([
|
|
96
90
|
chalk.green('開始自動觀看'),
|
|
97
|
-
`課程: ${chalk.cyan(
|
|
91
|
+
`課程: ${chalk.cyan(config.courses.length)} 個`,
|
|
98
92
|
`模式: ${headless ? chalk.gray('無頭') : chalk.white('有頭')}`,
|
|
99
93
|
`倍速: ${chalk.yellow(config.playbackRate || 2)}x`,
|
|
100
94
|
]);
|
|
101
95
|
console.log('');
|
|
102
96
|
|
|
103
97
|
const { runWithSelection } = require('./index');
|
|
104
|
-
await runWithSelection(
|
|
98
|
+
await runWithSelection(config.courses, headless);
|
|
105
99
|
await pressAnyKey();
|
|
106
100
|
}
|
|
107
101
|
|