diff options
Diffstat (limited to 'pkgs/by-name/mp/mpdpopm/src/storage/mod.rs')
| -rw-r--r-- | pkgs/by-name/mp/mpdpopm/src/storage/mod.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/pkgs/by-name/mp/mpdpopm/src/storage/mod.rs b/pkgs/by-name/mp/mpdpopm/src/storage/mod.rs index 325b633a..d64f17c1 100644 --- a/pkgs/by-name/mp/mpdpopm/src/storage/mod.rs +++ b/pkgs/by-name/mp/mpdpopm/src/storage/mod.rs @@ -16,10 +16,6 @@ pub enum Error { source: crate::clients::Error, back: Backtrace, }, - Rating { - source: crate::ratings::Error, - back: Backtrace, - }, } impl std::fmt::Display for Error { @@ -31,7 +27,6 @@ impl std::fmt::Display for Error { write!(f, "Couldn't get system time: {}", source) } Error::Client { source, back: _ } => write!(f, "Client error: {}", source), - Error::Rating { source, back: _ } => write!(f, "Rating error: {}", source), } } } @@ -93,7 +88,10 @@ pub mod play_count { #[tokio::test] async fn pc_smoke() { let mock = Box::new(Mock::new(&[ - ("sticker get song a unwoundstack.com:playcount", "sticker: unwoundstack.com:playcount=11\nOK\n"), + ( + "sticker get song a unwoundstack.com:playcount", + "sticker: unwoundstack.com:playcount=11\nOK\n", + ), ( "sticker get song a unwoundstack.com:playcount", "ACK [50@0] {sticker} no such sticker\n", @@ -188,9 +186,9 @@ pub mod rating_count { pub const STICKER: &str = "unwoundstack.com:ratings_count"; /// Retrieve the rating count for a track - pub async fn get(client: &mut Client, file: &str) -> Result<Option<u8>> { + pub async fn get(client: &mut Client, file: &str) -> Result<Option<i8>> { client - .get_sticker::<u8>(file, STICKER) + .get_sticker::<i8>(file, STICKER) .await .map_err(|err| Error::Client { source: err, @@ -199,7 +197,7 @@ pub mod rating_count { } /// Set the rating count for a track - pub async fn set(client: &mut Client, file: &str, rating_count: u8) -> Result<()> { + pub async fn set(client: &mut Client, file: &str, rating_count: i8) -> Result<()> { client .set_sticker(file, STICKER, &format!("{}", rating_count)) .await |
