diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-02-19 22:55:26 +0100 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-02-19 22:55:26 +0100 |
| commit | 4e01cf07dd9bcb3e7441ef51ef27852dc04e5cf8 (patch) | |
| tree | a480e4506f3450959f9a9bb156f5018298536acf /pkgs/by-name/mp/mpdpopm/src/playcounts.rs | |
| parent | pkgs/mpdpopmd: Fix test (diff) | |
| download | nixos-config-4e01cf07dd9bcb3e7441ef51ef27852dc04e5cf8.zip | |
pkgs/mpdpopmd: Correct boolean response on Play->Stop transition prime
Diffstat (limited to 'pkgs/by-name/mp/mpdpopm/src/playcounts.rs')
| -rw-r--r-- | pkgs/by-name/mp/mpdpopm/src/playcounts.rs | 18 |
1 files changed, 12 insertions, 6 deletions
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 { |
