diff --git a/Cargo.toml b/Cargo.toml
index d47d162..55232bd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,12 +13,17 @@ license = "Apache-2.0/MIT"
edition = "2021"
[dependencies]
-failure = "0.1.3"
-log = "0.4.6"
-md5 = "0.6.0"
-rand = "0.6.1"
+thiserror = "1.0"
+log = "0.4"
+md5 = "0.7"
+rand = "0.8"
readonly = "0.2"
-serde = "1.0.80"
-serde_derive = "1.0.80"
-serde_json = "1.0.33"
-reqwest = "0.9.5"
+serde = "1"
+serde_derive = "1"
+serde_json = "1"
+reqwest = { version = "0.11", features = ["json"] }
+async-trait = "0.1.67"
+url = "2.3.1"
+
+[dev-dependencies]
+tokio-test = "0.4.2"
diff --git a/src/annotate.rs b/src/annotate.rs
index b1afb58..273a93d 100644
--- a/src/annotate.rs
+++ b/src/annotate.rs
@@ -4,15 +4,16 @@ use crate::query::Query;
use crate::{Album, Artist, Client, Error, Result, Song};
/// Allows starring, rating, and scrobbling media.
+#[async_trait::async_trait]
pub trait Annotatable {
/// Attaches a star to the content.
- fn star(&self, client: &Client) -> Result<()>;
+ async fn star(&self, client: &Client) -> Result<()>;
/// Removes a star from the content.
- fn unstar(&self, client: &Client) -> Result<()>;
+ async fn unstar(&self, client: &Client) -> Result<()>;
/// Sets the rating for the content.
- fn set_rating(&self, client: &Client, rating: u8) -> Result<()>;
+ async fn set_rating(&self, client: &Client, rating: u8) -> Result<()>;
/// Registers the local playback of the content. Typically used when playing
/// media that is cached on the client. This operation includes the
@@ -29,113 +30,125 @@ pub trait Annotatable {
///
/// `time` should be a valid ISO8601 timestamp. In the future, this will be
/// validated.
- fn scrobble<'a, B, T>(&self, client: &Client, time: T, now_playing: B) -> Result<()>
+ async fn scrobble<'a, B: Send, T: Send>(
+ &self,
+ client: &Client,
+ time: T,
+ now_playing: B,
+ ) -> Result<()>
where
B: Into