-
Notifications
You must be signed in to change notification settings - Fork 6
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
Look into setting alternative Listenbrainz hosts for a session #2
Comments
I think we can add an API URL field to |
Got it working... I think. Pushing my branch for evaluation - do you want me to open a PR? Need to adjust unit tests, and add additional examples. Other than that, looks like a clean fix ... |
OK, I can confirm the fix works |
Having said that - we don't seem to have unit tests? |
Perfect! Yeah, you can open a PR. |
Correct, there are currently no unit tests. Definitely something that needs to be added. I've made an issue (#5) |
This commit adds support for alternative Listenbrainz hosts. L10 defines the most used official host for Listenbrainz. I have refactored the Client struct to have the `api_root_url` field. This is automatically set to the value L10 defines, when a Client is instantiated with `new()`. On the invocation of `client_with_url(url: &str)`, the `api_root_url` field is set to the Listenbrainz instance API root URL passed to the function. The 1:1 functions <-> API methods have been modified to use `self.api_root_url` as the base of the `format!()` macro invoked, rather than the global constant of `API_ROOT_URL`. This commit has been tested with the examples, and appears to be functional. Fixes #2. Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
Pushed to the |
As the title says...
The text was updated successfully, but these errors were encountered: