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

Add utility method getService() to Info object #646

Merged
merged 2 commits into from
Jun 5, 2021

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Jun 5, 2021

In the client, it often happens that the StreamingService for an Info object needs to be obtained. Before, this could not be done inline and required 6 lines of code:

final StreamingService service;
try {
    service = NewPipe.getService(infoObject.getServiceId());
} catch (ExtractionException e) {
    // unreachable code
}

I added a shortand getService() method to the Info object, so now that whole lot of code is just replaced by infoObject.getService().

@TobiGr TobiGr merged commit 8c42a48 into TeamNewPipe:dev Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants