Skip to content

Commit

Permalink
Custom args and global custom args now use double comma as a delimite…
Browse files Browse the repository at this point in the history
…r. This should allow file names with spaces when using custom args (global and not)
  • Loading branch information
Tzahi12345 committed May 4, 2020
1 parent 1861011 commit 8e5db3e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions backend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@ async function generateArgs(url, type, options) {
}

if (customArgs) {
downloadConfig = customArgs.split(' ');
downloadConfig = customArgs.split(',,');
} else {
if (customQualityConfiguration) {
qualityPath = `-f ${customQualityConfiguration}`;
Expand Down Expand Up @@ -1535,7 +1535,7 @@ async function generateArgs(url, type, options) {

if (globalArgs && globalArgs !== '') {
// adds global args
downloadConfig = downloadConfig.concat(globalArgs.split(' '));
downloadConfig = downloadConfig.concat(globalArgs.split(',,'));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ export class ArgModifierDialogComponent implements OnInit {
}

addArg() {
if (!this.modified_args) {
this.modified_args = '';
}
// adds space
if (this.modified_args !== '') {
this.modified_args += ' ';
this.modified_args += ',,';
}

this.modified_args += this.stateCtrl.value + ' ' + (this.secondArgEnabled ? this.secondArg : '');
this.modified_args += this.stateCtrl.value + (this.secondArgEnabled ? ',,' + this.secondArg : '');
}

canAddArg() {
Expand Down
4 changes: 2 additions & 2 deletions src/app/main/main.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ export class MainComponent implements OnInit {
const base_string_array = ['youtube-dl', this.url];

if (customArgsExists) {
this.simulatedOutput = base_string_array.join(' ') + ' ' + this.customArgs;
this.simulatedOutput = base_string_array.join(' ') + ' ' + this.customArgs.split(',,').join(' ');
return this.simulatedOutput;
}

Expand Down Expand Up @@ -924,7 +924,7 @@ export class MainComponent implements OnInit {
}

if (globalArgsExists) {
full_string_array = full_string_array.concat(this.globalCustomArgs.split(' '));
full_string_array = full_string_array.concat(this.globalCustomArgs.split(',,'));
}

this.simulatedOutput = full_string_array.join(' ');
Expand Down

0 comments on commit 8e5db3e

Please sign in to comment.