Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Map to List to use the same command option multiple times #170

Closed
JunkFood02 opened this issue Aug 3, 2022 · 0 comments · Fixed by #172
Closed

Change Map to List to use the same command option multiple times #170

JunkFood02 opened this issue Aug 3, 2022 · 0 comments · Fixed by #172
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@JunkFood02
Copy link
Collaborator

Many command options of yt-dlp can be used multiple times, e.g --parse-metadata here.

Using Map instead of List for saving commands makes multiple usages of the same options impossible, which will only store the last value stored for the same key.

public List<String> buildOptions(){
List<String> optionsList = new ArrayList<>();
for (Map.Entry<String, String> entry : options.entrySet()) {
String name = entry.getKey();
String value = entry.getValue();
optionsList.add(name);
if(null != value) optionsList.add(value);
}
return optionsList;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant