Commit Graph

83 Commits

Author SHA1 Message Date
cel 🌸 b0cd2d6b8a
make more fields optional 2023-01-16 05:05:27 +00:00
cel 🌸 65a62d6118
make user_name optional 2023-01-16 05:03:20 +00:00
Koen Bolhuis daad9596d0 Release v0.5.0 2022-12-05 00:35:33 +01:00
Koen Bolhuis 4d6cd43805
Merge pull request #11 from mgziminsky/patch-1
Make release optional in API wrapper
2022-12-05 00:28:19 +01:00
Michael Ziminsky (Z) b4a2a91d65 Make release optional in API wrapper
Fixes #10
2022-12-04 14:07:45 -07:00
Koen Bolhuis 6b1dae4e64
Update CHANGELOG.md 2022-11-16 02:19:10 +01:00
Koen Bolhuis 8e4299d919 Release v0.4.3 2022-11-16 02:15:21 +01:00
Koen Bolhuis 77848d35cd Move to rust 2021 2022-11-16 02:14:31 +01:00
Koen Bolhuis 88dbad9062 Update attohttpc dependency 2022-11-16 02:13:57 +01:00
Koen Bolhuis 9f4c763947 Release v0.4.2 2022-05-12 00:05:57 +02:00
Koen Bolhuis 3d156516c6 Add ListenBrainz::import() method
Allows importing listens at a specified timestamp.
2022-05-12 00:04:19 +02:00
Koen Bolhuis b3868fa128 Bump version 2021-12-03 13:04:02 +01:00
Koen Bolhuis 763b5b62ee Implement Default for raw::Client and wrapper::ListenBrainz
Following clippy recommendations
2021-12-03 12:55:03 +01:00
Koen Bolhuis 0c3125bd14 Add api_url() method to raw::Client and wrapper::ListenBrainz 2021-12-03 12:47:26 +01:00
Koen Bolhuis 0b18a3230b Fix Maloja link in docs 2021-12-03 12:43:31 +01:00
Koen Bolhuis 6d1ed98163 Release v0.4.0 2021-10-21 00:38:05 +02:00
Koen Bolhuis 5dd96b3179 Add ListenBrainz::new_with_url constructor
Analogous to raw::Client::new_with_url
2021-10-20 19:19:27 +02:00
Koen Bolhuis 672aff1565 Update changelog 2021-10-20 00:07:03 +02:00
Koen Bolhuis e9fd33a7b3 Add lints
Add some useful #![deny(...)] lints:
- missing_docs to disallow undocumented public items;
- missing_debug_implementations for public types;
- no unsafe code or unstable features.
2021-10-19 23:58:30 +02:00
Koen Bolhuis f3d2666960 Add CI status badge to README 2021-10-19 23:35:50 +02:00
Koen Bolhuis 1e611f1182
Merge pull request #7 from InputUsername/feature/use-attohttpc
Use the attohttpc crate instead of ureq
2021-09-02 00:14:25 +02:00
Koen Bolhuis c1bb3f39f4 Run rustfmt 2021-09-01 18:14:04 +02:00
Koen Bolhuis c49f40128d Use the attohttpc crate instead of ureq.
This has some implications for Error:
- because attohttpc doesn't distinguish between errors
  when serializing or deserializing request/response
  data, Error::RequestJson and Error::ResponseJson have
  been merged into Error::Json. In practice this shouldn't
  matter much because request data is (usually) well-formed.
- attohttpc also doesn't return errors for HTTP responses
  with statuses in the [400-599] range, so manual conversion
  to an error is needed (this now happens in ResponseType::from_response).
2021-09-01 18:04:56 +02:00
Koen Bolhuis 8b195d1651
Merge pull request #6 from InputUsername/feature/alternative-hosts
Add support for alternative Listenbrainz hosts
2021-08-30 18:12:58 +02:00
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
Koen Bolhuis 15e2a86819
Merge pull request #1 from InputUsername/github/actions-support
Add CI builds support
2021-08-30 13:01:51 +02:00
Dom Rodriguez 4a45692f13
Add CI builds support
This uses GitHub Actions, it builds listenbrainz-rs and runs unit tests
if applicable.

It is triggered by the following GitHub events:

- A push to the repo
- A PR made to the repo

Of course, it's not strictly necssary to use GitHub Actions; there are
other services.

Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-08-29 19:01:59 +01:00
Koen Bolhuis 8764854fad Release v0.3.0 2021-05-12 20:32:51 +02:00
Koen Bolhuis ada26387a5 Add license badge to readme 2021-01-30 03:21:23 +01:00
Koen Bolhuis 3aa23c833b Add rate limiting information to changelog 2021-01-30 03:12:29 +01:00
Koen Bolhuis 44319feb79 Add rate limiting example 2021-01-30 03:08:42 +01:00
Koen Bolhuis 508f697a51 Add rate limiting information to response types
Add the `rate_limit` field to all response types,
which contains rate limiting information such as
maximum and remaining requests in the current
time frame, as well as when the next time frame
starts.

All response types now also implement the `ResponseType`
trait (internal for now). Currently this trait allows
converting from `ureq::Response` to the response type,
by extracting rate limiting information from the response
headers and deserializing the response body into the
response type.
2021-01-30 03:06:02 +01:00
Koen Bolhuis fd9c7823d7 Update comment for ListenBrainz::playing_now 2021-01-30 02:31:57 +01:00
Koen Bolhuis c6a2cbc55b Add comparison with listenbrainz-rust to readme 2021-01-30 02:31:04 +01:00
Koen Bolhuis 91ceaa3f42 Release v0.2.0 2021-01-20 01:14:33 +01:00
Koen Bolhuis e2586806e0 Update changelog 2021-01-20 01:13:27 +01:00
Koen Bolhuis 2ff97ce9d2 Run rustfmt 2021-01-20 01:13:13 +01:00
Koen Bolhuis c76d0d9d89 Add example to crate root 2021-01-20 01:11:47 +01:00
Koen Bolhuis ca86b987e4 Polish ListenBrainz docs 2021-01-20 01:11:39 +01:00
Koen Bolhuis ae9b342474 Improve docs for the ListenBrainz type 2021-01-20 00:57:03 +01:00
Koen Bolhuis b4c4226677 Represent invalid tokens with an error instead of a boolean 2021-01-20 00:52:10 +01:00
Koen Bolhuis 5f6c5f5375 Improve crate documentation 2021-01-20 00:37:39 +01:00
Koen Bolhuis f72ab1cbdf Add error documentation to ListenBrainz::playing_now 2021-01-20 00:26:27 +01:00
Koen Bolhuis 9ed9ebfe0f Move Endpoint to raw module 2021-01-20 00:23:35 +01:00
Koen Bolhuis 7f07ecfb32 Add ListenBrainz type
The ListenBrainz struct is a more ergonomic client
than raw::Client. It supports authentication using
a ListenBrainz token. Currently, it allows submitting
"listened" and "now playing" requests to the API
in a more convenient way than manually creating all
request data.
2021-01-20 00:16:53 +01:00
Koen Bolhuis 02060d8476 Update changelog 2021-01-19 23:55:03 +01:00
Koen Bolhuis 56a50d936c Move Client to raw module 2021-01-19 23:51:17 +01:00
Koen Bolhuis a22fcff2bf Move low-level models to raw module 2021-01-19 23:41:54 +01:00
Koen Bolhuis 83fa18e048 Improve Client documentation
Add information on errors returned by Client's methods,
as well as comments for internal helper methods.
2021-01-15 23:35:00 +01:00
Koen Bolhuis 6309a544ef Change all Client methods from &mut self to &self 2021-01-15 01:04:46 +01:00