Skip to content

Commit 0fd4c52

Browse files
committed
fix: update CCExtractor args to correct format
1 parent c07c619 commit 0fd4c52

File tree

7 files changed

+74
-76
lines changed

7 files changed

+74
-76
lines changed

lib/models/settings_model.dart

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -223,80 +223,80 @@ class SettingsModel {
223223

224224
static Map<String, String> get paramsLookUpMap {
225225
return {
226-
'out': '-out=',
227-
'inp': '-in=',
226+
'out': '--out=',
227+
'inp': '--input=',
228228
'outputfilename': '-o',
229-
'fixptsjumps': '-fixptsjumps',
229+
'fixptsjumps': '--fixptsjumps',
230230
'append': '--append',
231231
'service': '--service',
232232
'outInterval': '--outinterval',
233233
'segmentonkeyonly': '--segmentonkeyonly',
234234
'goptime': '--goptime',
235-
'nogoptime': '--nogoptime',
235+
'nogoptime': '--no-goptime',
236236
'fixpadding': '--fixpadding',
237-
'freqEs15': '-90090',
237+
'freqEs15': '--90090',
238238
'stream': '--stream',
239239
'videoedited': '--videoedited',
240240
'usepicorder': '--usepicorder',
241-
'myth': '-myth',
242-
'nomyth': '-nomyth',
243-
'wtvconvertfix': '-wtvconvertfix',
244-
'wtvmpeg2': '-wtvmpeg2',
241+
'myth': '--myth',
242+
'nomyth': '--no-myth',
243+
'wtvconvertfix': '--wtvconvertfix',
244+
'wtvmpeg2': '--wtvmpeg2',
245245
'program_number': '--program-number',
246-
'autoprogram': '-autoprogram',
247-
'multiprogram': '-multiprogram',
248-
'streamtype': '-streamtype',
246+
'autoprogram': '--autoprogram',
247+
'multiprogram': '--multiprogram',
248+
'streamtype': '--streamtype',
249249
'hauppauge': '--hauppauge',
250-
'mp4vidtrack': '-mp4vidtrack',
251-
'noautotimeref': '-noautotimeref',
252-
'noscte20': '--noscte20',
250+
'mp4vidtrack': '--mp4vidtrack',
251+
'noautotimeref': '--no-autotimeref',
252+
'noscte20': '--no-scte20',
253253
'webvttcss': '--webvtt-create-css',
254254
'analyzevideo': '--analyzevideo',
255255
'notimestamp': '--no-timestamp-map',
256-
'nolevdist': '-nolevdist',
257-
'minlevdist': '-levdistmincnt',
258-
'maxlevdist': '-levdistmaxpct',
259-
'chapters': '-chapters',
260-
'bom': '-bom',
261-
'nobom': '-nobom',
262-
'nofontcolor': '--nofontcolor',
263-
'nohtmlescape': '--nohtmlescape',
264-
'notypesetting': '--notypesetting',
265-
'trim': '-trim',
256+
'nolevdist': '--no-levdist',
257+
'minlevdist': '--levdistmincnt',
258+
'maxlevdist': '--levdistmaxpct',
259+
'chapters': '--chapters',
260+
'bom': '--bom',
261+
'nobom': '--no-bom',
262+
'nofontcolor': '--no-fontcolor',
263+
'nohtmlescape': '--no-htmlescape',
264+
'notypesetting': '--no-typesetting',
265+
'trim': '--trim',
266266
'defaultcolor': '--defaultcolor',
267267
'sentencecap': '--sentencecap',
268268
'capFile': '--capfile',
269269
'kf': '--kf',
270270
'profanityFile': '--profanity-file',
271271
'splitbysentence': '--splitbysentence',
272-
'datets': '-datets',
273-
'sects': '-sects',
274-
'latrusmap': '-latrusmap',
275-
'xds': '=xds',
276-
'lf': '-lf',
277-
'df': '-df',
278-
'autodash': '- autodash',
279-
'xmltv': '-xmltv',
280-
'xmltvliveinterval': '-xmltvliveinterval',
281-
'xmltvoutputinterval': '-xmltvoutputinterval',
282-
'xmltvonlycurrent': '-xmltvonlycurrent',
283-
'sem': '-sem',
284-
'dvblang': '-dvblang',
285-
'ocrlang': '-ocrlang',
286-
'mkvlang': '-mkvlang',
287-
'quant': '-quant',
288-
'oem': '-oem',
272+
'datets': '--datets',
273+
'sects': '--sects',
274+
'latrusmap': '--latrusmap',
275+
'xds': '--xds',
276+
'lf': '--lf',
277+
'df': '--df',
278+
'autodash': '--autodash',
279+
'xmltv': '--xmltv',
280+
'xmltvliveinterval': '--xmltvliveinterval',
281+
'xmltvoutputinterval': '--xmltvoutputinterval',
282+
'xmltvonlycurrent': '--xmltvonlycurrent',
283+
'sem': '--sem',
284+
'dvblang': '--dvblang',
285+
'ocrlang': '--ocrlang',
286+
'mkvlang': '--mkvlang',
287+
'quant': '--quant',
288+
'oem': '--oem',
289289
'bufferinput': '--bufferinput',
290-
'nobufferinput': '-nobufferinput',
290+
'nobufferinput': '--no-bufferinput',
291291
'buffersize': '--buffersize',
292-
'koc': '-koc',
293-
'dru': '-dru',
294-
'norollup': '--norollup',
295-
'delay': '-delay',
296-
'startat': '-startat',
297-
'endat': '-endat',
298-
'codec': '-codec',
299-
'nocodec': 'nocodec',
292+
'koc': '--koc',
293+
'dru': '--dru',
294+
'norollup': '--no-rollup',
295+
'delay': '--delay',
296+
'startat': '--startat',
297+
'endat': '--endat',
298+
'codec': '--codec',
299+
'nocodec': '--no-codec',
300300
'startcreditstext': '--startcreditstext',
301301
'startcreditsnotbefore': '--startcreditsnotbefore',
302302
'startcreditsnotafter': '--startcreditsnotafter',
@@ -305,17 +305,17 @@ class SettingsModel {
305305
'endcreditstext': '--endcreditstext',
306306
'endcreditsforatleast': '--endcreditsforatleast',
307307
'endcreditsforatmost': '--endcreditsforatmost',
308-
'tpage': '-tpage',
309-
'teletext': '-teletext',
310-
'noteletext': '-noteletext',
311-
'hardsubx': '-hardsubx',
312-
'tickertext': '-tickertext',
313-
'ocrMode': '-ocr_mode',
314-
'subcolor': '-subcolor',
315-
'minSubDuration': '-min_sub_duration',
316-
'detectItalics': '-detect_italics',
317-
'confThresh': '-conf_thresh',
318-
'whiteThresh': '-whiteness_thresh',
308+
'tpage': '--tpage',
309+
'teletext': '--teletext',
310+
'noteletext': '--no-teletext',
311+
'hardsubx': '--hardsubx',
312+
'tickertext': '--tickertext',
313+
'ocrMode': '--ocr-mode',
314+
'subcolor': '--subcolor',
315+
'minSubDuration': '--min-sub-duration',
316+
'detectItalics': '--detect-italics',
317+
'confThresh': '--conf-thresh',
318+
'whiteThresh': '--whiteness-thresh',
319319
'splitMode': '', // splitMode is not a ccx setting
320320
};
321321
}

lib/repositories/ccextractor.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CCExtractor {
3333
ccextractor,
3434
[
3535
file.path,
36-
'--gui_mode_reports',
36+
'--gui-mode-reports',
3737
...paramsList,
3838
],
3939
);
@@ -87,9 +87,9 @@ class CCExtractor {
8787
[
8888
'-' + type,
8989
location,
90-
tcppasswrd.isNotEmpty ? '-tcppasswrd' + tcppasswrd : '',
91-
tcpdesc.isNotEmpty ? '-tcpdesc' + tcpdesc : '',
92-
'--gui_mode_reports',
90+
tcppasswrd.isNotEmpty ? '--tcp-password ' + tcppasswrd : '',
91+
tcpdesc.isNotEmpty ? '--tcp-description ' + tcpdesc : '',
92+
'--gui-mode-reports',
9393
...paramsList,
9494
],
9595
);
@@ -141,7 +141,7 @@ class CCExtractor {
141141
ccextractor,
142142
[
143143
...files.map((e) => e.path).toList(),
144-
'--gui_mode_reports',
144+
'--gui-mode-reports',
145145
...paramsList,
146146
],
147147
);

lib/repositories/settings_repository.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ class SettingsRepository {
6161

6262
settings.enabledtextfields.forEach((param) {
6363
if (!{'encoder', 'rollUp', 'out', 'inp'}.contains(param.keys.first)) {
64-
// no --encoder direct -latin1 or -utf8
65-
// -out=format // no space
64+
// no --encoder direct --latin1 or --utf8
65+
// --out=format // no space
6666
paramsList.add(SettingsModel.paramsLookUpMap[param.keys.first]!);
6767
}
6868
if (param.keys.first == 'outputfilename' && filePath.isNotEmpty) {
6969
paramsList.add(
7070
'${filePath.substring(0, filePath.lastIndexOf(RegExp(r'(\\|\/)')))}/${param.values.first}');
7171
} else if ({'encoder', 'rollUp'}.contains(param.keys.first)) {
72-
paramsList.add('-' + param.values.first);
72+
paramsList.add('--' + param.values.first);
7373
} else if (param.keys.first == 'out' || param.keys.first == 'inp') {
7474
paramsList.add(SettingsModel.paramsLookUpMap[param.keys.first]! +
7575
param.values.first);
@@ -87,8 +87,6 @@ class SettingsRepository {
8787
paramsList.add(param.values.first);
8888
}
8989
});
90-
// print(paramsList);
91-
// [--append, -autoprogram, -out=webvtt, -utf8]
9290
return paramsList;
9391
}
9492

lib/screens/settings/components/current_command.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class CurrentCommandContainer extends StatelessWidget {
7575
child: Padding(
7676
padding: const EdgeInsets.only(left: 10),
7777
child: SelectableText(
78-
'ccextractor --gui_mode_reports ${paramsList.reduce((value, element) => value + ' ' + element)} +[input files]',
78+
'ccextractor --gui-mode-reports ${paramsList.reduce((value, element) => value + ' ' + element)} +[input files]',
7979
// maxLines: 2,
8080
style: TextStyle(
8181
fontSize: 15,

lib/screens/settings/input_settings.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class InputSettingsScreen extends StatelessWidget {
242242
CustomSwitchListTile(
243243
title: 'No auto time ref',
244244
subtitle:
245-
'Some streams come with broadcast date information. When such data is available, CCExtractor will set its time reference to the received data. Use this parameter if prefer your own reference. Note: Current this only affects Teletext in timed transcript with -datets.',
245+
'Some streams come with broadcast date information. When such data is available, CCExtractor will set its time reference to the received data. Use this parameter if prefer your own reference. Note: Current this only affects Teletext in timed transcript with --datets.',
246246
value: state.settingsModel.noautotimeref,
247247
onTap: (value) {
248248
context.read<SettingsBloc>().add(

lib/screens/settings/output_settings.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ class OutputSettingsScreen extends StatelessWidget {
413413
CustomSwitchListTile(
414414
title: 'Autodash',
415415
subtitle:
416-
'Based on position on screen, attempt to determine the different speakers and a dash (-) when each of them talks (.srt/.vtt only, -trim required).',
416+
'Based on position on screen, attempt to determine the different speakers and a dash (-) when each of them talks (.srt/.vtt only, --trim required).',
417417
value: state.settingsModel.autodash,
418418
onTap: (value) {
419419
context.read<SettingsBloc>().add(

test/bloc_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void main() {
4141
expect(
4242
_settingsRepository
4343
.getParamsList(settingsModel)
44-
.contains('-autoprogram'),
44+
.contains('--autoprogram'),
4545
false);
4646
expect(
4747
_settingsRepository

0 commit comments

Comments
 (0)