implemented global custom args functionality

fixed bad logic in settings
This commit is contained in:
Isaac Grynsztein
2020-03-08 22:47:08 -04:00
parent 73d4cca615
commit 946abd2e92
4 changed files with 21 additions and 3 deletions

View File

@@ -801,8 +801,9 @@ export class MainComponent implements OnInit {
getSimulatedOutput() {
const customArgsExists = this.customArgsEnabled && this.customArgs;
const globalArgsExists = this.globalCustomArgs && this.globalCustomArgs !== '';
const full_string_array: string[] = [];
let full_string_array: string[] = [];
const base_string_array = ['youtube-dl', this.url];
if (customArgsExists) {
@@ -861,6 +862,10 @@ export class MainComponent implements OnInit {
full_string_array.push(...additional_params);
}
if (globalArgsExists) {
full_string_array = full_string_array.concat(this.globalCustomArgs.split(' '));
}
this.simulatedOutput = full_string_array.join(' ');
return this.simulatedOutput;
}