Compare commits
5 Commits
77848d35cd
...
daad9596d0
Author | SHA1 | Date |
---|---|---|
Koen Bolhuis | daad9596d0 | |
Koen Bolhuis | 4d6cd43805 | |
Michael Ziminsky (Z) | b4a2a91d65 | |
Koen Bolhuis | 6b1dae4e64 | |
Koen Bolhuis | 8e4299d919 |
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -1,5 +1,17 @@
|
|||
# Changelog
|
||||
|
||||
## v0.5.0 (2022-12-05)
|
||||
|
||||
- Made the `release` parameter of `ListenBrainz` methods optional ([#11], [@mgziminsky]).
|
||||
- This is a breaking change.
|
||||
|
||||
[#11]: https://github.com/InputUsername/listenbrainz-rs/pull/11
|
||||
[@mgziminsky]: https://github.com/mgziminsky
|
||||
|
||||
## v0.4.3 (2022-11-16)
|
||||
|
||||
- Updated attohttpc dependency.
|
||||
|
||||
## v0.4.2 (2022-05-12)
|
||||
|
||||
- Added the `ListenBrainz::import()` method to allow importing
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "listenbrainz"
|
||||
version = "0.4.2"
|
||||
version = "0.5.0"
|
||||
authors = ["Koen Bolhuis <koen.bolhuis@gmail.com>"]
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
//! client.authenticate("LISTENBRAINZ TOKEN")
|
||||
//! .expect("Could not authenticate with ListenBrainz");
|
||||
//!
|
||||
//! client.playing_now("The Beatles", "Here Comes the Sun", "Abbey Road")
|
||||
//! client.playing_now("The Beatles", "Here Comes the Sun", Some("Abbey Road"))
|
||||
//! .expect("Could not submit 'playing now' request");
|
||||
//! ```
|
||||
//!
|
||||
|
@ -34,7 +34,7 @@
|
|||
//! client.authenticate("MALOJA API KEY")
|
||||
//! .expect("Could not authenticate with Maloja");
|
||||
//!
|
||||
//! client.listen("Lymbyc Systym", "Split Stones", "Split Stones")
|
||||
//! client.listen("Lymbyc Systym", "Split Stones", None)
|
||||
//! .expect("Could not submit listen");
|
||||
//! ```
|
||||
//!
|
||||
|
|
|
@ -89,7 +89,7 @@ impl ListenBrainz {
|
|||
timestamp: Option<i64>,
|
||||
artist: &str,
|
||||
track: &str,
|
||||
release: &str,
|
||||
release: Option<&str>,
|
||||
) -> Result<(), Error> {
|
||||
if !self.is_authenticated() {
|
||||
return Err(Error::NotAuthenticated);
|
||||
|
@ -100,7 +100,7 @@ impl ListenBrainz {
|
|||
track_metadata: TrackMetadata {
|
||||
artist_name: artist,
|
||||
track_name: track,
|
||||
release_name: Some(release),
|
||||
release_name: release,
|
||||
additional_info: None,
|
||||
},
|
||||
};
|
||||
|
@ -125,7 +125,7 @@ impl ListenBrainz {
|
|||
/// If not authenticated, returns [`Error::NotAuthenticated`].
|
||||
/// Otherwise, see the Errors section of [`Client`] for more info on
|
||||
/// what errors might occur.
|
||||
pub fn listen(&self, artist: &str, track: &str, release: &str) -> Result<(), Error> {
|
||||
pub fn listen(&self, artist: &str, track: &str, release: Option<&str>) -> Result<(), Error> {
|
||||
let now = SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.unwrap()
|
||||
|
@ -144,7 +144,7 @@ impl ListenBrainz {
|
|||
/// If not authenticated, returns [`Error::NotAuthenticated`].
|
||||
/// Otherwise, see the Errors section of [`Client`] for more info on
|
||||
/// what errors might occur.
|
||||
pub fn import(&self, artist: &str, track: &str, release: &str, timestamp: i64) -> Result<(), Error> {
|
||||
pub fn import(&self, artist: &str, track: &str, release: Option<&str>, timestamp: i64) -> Result<(), Error> {
|
||||
self.submit_listen(ListenType::Import, Some(timestamp), artist, track, release)
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ impl ListenBrainz {
|
|||
/// If not authenticated, returns [`Error::NotAuthenticated`].
|
||||
/// Otherwise, see the Errors section of [`Client`] for more info on
|
||||
/// what errors might occur.
|
||||
pub fn playing_now(&self, artist: &str, track: &str, release: &str) -> Result<(), Error> {
|
||||
pub fn playing_now(&self, artist: &str, track: &str, release: Option<&str>) -> Result<(), Error> {
|
||||
self.submit_listen(ListenType::PlayingNow, None, artist, track, release)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue