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 Search Endpoint #9

Merged
merged 7 commits into from
Nov 21, 2018
Merged

Add Search Endpoint #9

merged 7 commits into from
Nov 21, 2018

Conversation

hayribakici
Copy link
Collaborator

This is a first attempt to add a search endpoint into this library. This is not a final stage, rather a discussion about the approach and maybe how it can be improved. Basically, this is the solution I came up with by giving the Pages class a Map of ParserFunctions (instead of only one) to enable distinguishing the different paging json objects in the search result.

@hayribakici hayribakici changed the title Add Search Endpoint. Add Search Endpoint Nov 10, 2018
}, onResume: () {
_bufferedPages.forEach(stream.add);
if (_bufferedPages.last.isLast) {
stream.close();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just added some formatting here.

Copy link
Owner

@rinukkusu rinukkusu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @hayribakici,
thanks for you contribution - looks pretty good overall. I've added some comments here and there, please check them out!

lib/src/endpoints/search.dart Outdated Show resolved Hide resolved
lib/src/endpoints/search.dart Outdated Show resolved Hide resolved
example/spotify_dart_example.dart Outdated Show resolved Hide resolved
example/spotify_dart_example.dart Outdated Show resolved Hide resolved
lib/src/endpoints/endpoint_paging.dart Outdated Show resolved Hide resolved
@hayribakici
Copy link
Collaborator Author

@rinukkusu hi,

I cleaned up the code. Now the EndpointPaging class contains another method called _getBundledPages(), which returns a set of Pages that can contain different datatypes. Both class Pages and BundledPages inherit from the abstract _Pages class, which contains just some common members.

I thought to add this comment to clarify potential confusion, because the PR diff is quite messy.
Thank you :)

lib/src/endpoints/endpoint_paging.dart Outdated Show resolved Hide resolved
lib/src/endpoints/search.dart Outdated Show resolved Hide resolved
@rinukkusu
Copy link
Owner

LGTM

Thank you for contributing this new endpoint! 😸

@rinukkusu rinukkusu merged commit d024e56 into rinukkusu:master Nov 21, 2018
@hayribakici hayribakici deleted the search branch February 15, 2019 13:23
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.

None yet

3 participants