aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/mp/mpdpopm/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm/cli.rs3
-rw-r--r--pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs2
-rw-r--r--pkgs/by-name/mp/mpdpopm/src/lib.rs2
-rw-r--r--pkgs/by-name/mp/mpdpopm/src/playcounts.rs18
4 files changed, 15 insertions, 10 deletions
diff --git a/pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm/cli.rs b/pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm/cli.rs
index c20bf3fa..7ec89441 100644
--- a/pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm/cli.rs
+++ b/pkgs/by-name/mp/mpdpopm/src/bin/mpdpopm/cli.rs
@@ -228,6 +228,5 @@ pub(crate) enum SubCommand {
/// Show general stats about your music collection.
///
/// This includes favorite artist, songs and also the negative ones.
- Stats {
- }
+ Stats {},
}
diff --git a/pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs b/pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs
index 2c3ddad6..3587df93 100644
--- a/pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs
+++ b/pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs
@@ -4,7 +4,7 @@ use std::{
};
use anyhow::{Context, Result};
-use rand::{Rng, distr};
+use rand::{RngExt, distr};
use tracing::info;
use crate::{clients::Client, storage};
diff --git a/pkgs/by-name/mp/mpdpopm/src/lib.rs b/pkgs/by-name/mp/mpdpopm/src/lib.rs
index 2394b729..6d04a527 100644
--- a/pkgs/by-name/mp/mpdpopm/src/lib.rs
+++ b/pkgs/by-name/mp/mpdpopm/src/lib.rs
@@ -47,7 +47,7 @@ pub mod vars;
#[allow(clippy::let_unit_value)]
#[allow(clippy::just_underscores_and_digits)]
pub mod filters {
- include!(concat!(env!("OUT_DIR"), "/src/filters.rs"));
+ include!(concat!(env!("OUT_DIR"), "/filters.rs"));
}
use crate::{
diff --git a/pkgs/by-name/mp/mpdpopm/src/playcounts.rs b/pkgs/by-name/mp/mpdpopm/src/playcounts.rs
index ae85b331..8fbee133 100644
--- a/pkgs/by-name/mp/mpdpopm/src/playcounts.rs
+++ b/pkgs/by-name/mp/mpdpopm/src/playcounts.rs
@@ -116,20 +116,26 @@ impl PlayState {
}
}
(PlayerStatus::Stopped, PlayerStatus::Play(_))
- | (PlayerStatus::Stopped, PlayerStatus::Pause(_))
- | (PlayerStatus::Pause(_), PlayerStatus::Stopped)
- | (PlayerStatus::Play(_), PlayerStatus::Stopped) => {
+ | (PlayerStatus::Stopped, PlayerStatus::Pause(_)) => {
self.have_incr_play_count = false;
- // We played and stopped or stopped and play now so we did probably not change the
- // song?
+ // We didn't play anything before and now we play something. This means that we
+ // obviously have something to play and thus don't need to add another song.
false
}
+ (PlayerStatus::Pause(_), PlayerStatus::Stopped)
+ | (PlayerStatus::Play(_), PlayerStatus::Stopped) => {
+ self.have_incr_play_count = false;
+
+ // We played a song before and now we stopped, maybe because we ran out of songs to
+ // play. So we need to add another one.
+ true
+ }
(PlayerStatus::Stopped, PlayerStatus::Stopped) => {
// We did not play before and we are still not playing, as such nothing really
// changed.
false
- },
+ }
};
match &new_stat {