Go to file
Dom Rodriguez e0d25815f0
Add support for alternative Listenbrainz hosts
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>
2021-08-30 16:26:39 +01:00
.github/workflows Add CI builds support 2021-08-29 19:01:59 +01:00
examples Add rate limiting example 2021-01-30 03:08:42 +01:00
src Add support for alternative Listenbrainz hosts 2021-08-30 16:26:39 +01:00
.gitignore Initial commit 2021-01-09 04:36:14 +01:00
CHANGELOG.md Release v0.3.0 2021-05-12 20:32:51 +02:00
Cargo.toml Release v0.3.0 2021-05-12 20:32:51 +02:00
LICENSE Add LICENSE, README.md and Cargo.toml fields 2021-01-10 21:50:29 +01:00
README.md Add license badge to readme 2021-01-30 03:21:23 +01:00
rustfmt.toml Add default rustfmt config 2021-01-14 03:29:15 +01:00

README.md

listenbrainz

Crate Documentation License

ListenBrainz API bindings for Rust.

There is also listenbrainz-rust. However, that crate only supports single listens, imports and now playing requests, and is also not maintained anymore. This crate, on the other hand, aims to be a complete API wrapper for the ListenBrainz API, version 1.