diff options
Diffstat (limited to '')
| -rw-r--r-- | pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm.rs b/pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm.rs index 82272aeb..5d4eeae4 100644 --- a/pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm.rs +++ b/pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm.rs @@ -31,7 +31,7 @@ use mpdpopm::{ config::{self, Config}, filters::ExpressionParser, filters_ast::{FilterStickerNames, evaluate}, - storage::{last_played, play_count, rating_count}, + storage::{last_played, play_count, rating}, }; use anyhow::{Context, Result, anyhow, bail}; @@ -93,7 +93,7 @@ async fn get_ratings( let mut ratings: Vec<(String, i8)> = Vec::new(); for file in map_tracks(client, tracks).await? { - let rating = rating_count::get(client, &file).await?; + let rating = rating::get(client, &file).await?; ratings.push((file, rating.unwrap_or_default())); } @@ -114,7 +114,7 @@ async fn set_rating(client: &mut Client, rating: i8, arg: Option<String>) -> Res let is_current = arg.is_none(); let file = provide_file(client, arg).await?; - rating_count::set(client, &file, rating).await?; + rating::set(client, &file, rating).await?; match is_current { false => info!("Set the rating for \"{}\" to \"{}\".", file, rating), @@ -129,9 +129,9 @@ async fn inc_rating(client: &mut Client, arg: Option<String>) -> Result<()> { let is_current = arg.is_none(); let file = provide_file(client, arg).await?; - let now = rating_count::get(client, &file).await?; + let now = rating::get(client, &file).await?; - rating_count::set(client, &file, now.unwrap_or_default().saturating_add(1)).await?; + rating::set(client, &file, now.unwrap_or_default().saturating_add(1)).await?; match is_current { false => info!("Incremented the rating for \"{}\".", file), @@ -146,9 +146,9 @@ async fn decr_rating(client: &mut Client, arg: Option<String>) -> Result<()> { let is_current = arg.is_none(); let file = provide_file(client, arg).await?; - let now = rating_count::get(client, &file).await?; + let now = rating::get(client, &file).await?; - rating_count::set(client, &file, now.unwrap_or_default().saturating_sub(1)).await?; + rating::set(client, &file, now.unwrap_or_default().saturating_sub(1)).await?; match is_current { false => info!("Decremented the rating for \"{}\".", file), @@ -323,7 +323,7 @@ enum RatingCommand { /// on stdout. With multiple arguments, print their ratings on stdout, one /// per line, prefixed by the track name. /// - /// Ratings are expressed as an integer between 0 & 255, inclusive, with + /// Ratings are expressed as an integer between -128 & 128, exclusive, with /// the convention that 0 denotes "un-rated". #[clap(verbatim_doc_comment)] Get { @@ -462,16 +462,16 @@ enum SubCommand { /// This command adds three new terms on which you can filter: rating, playcount & lastplayed. Each is /// expressed as an unsigned integer, with zero interpreted as "not set". For instance: /// - /// mppopm searchadd "(rating > 128)" + /// mppopm searchadd "(rating > 2)" /// - /// Will add all songs in the library with a rating sticker > 128 to the play queue. + /// Will add all songs in the library with a rating sticker > 2 to the play queue. /// /// mppopm also introduces OR clauses (MPD only supports AND), so that: /// - /// mppopm searchadd "((rating > 128) AND (artist =~ \"pogues\"))" + /// mppopm searchadd "((rating > 2) AND (artist =~ \"pogues\"))" /// /// will add all songs whose artist tag matches the regexp "pogues" with a rating greater than - /// 128. + /// 2. #[clap(verbatim_doc_comment)] Searchadd { filter: String, |
