diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-01-31 16:32:15 +0100 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-01-31 16:32:15 +0100 |
| commit | 63a880b8281a24c1e606ae765c3e54fdc68c787a (patch) | |
| tree | 08391875954652cc39e1c0408bc6ed4f4b9c0ded /pkgs/by-name/mp/mpdpopm/src/dj | |
| parent | pkgs/mpdpopm: Add a (basic) dj mode (diff) | |
| download | nixos-config-63a880b8281a24c1e606ae765c3e54fdc68c787a.zip | |
pkgs/mpdpopm: Actually report, which kind of track we added
Diffstat (limited to 'pkgs/by-name/mp/mpdpopm/src/dj')
| -rw-r--r-- | pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs b/pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs index fcb05817..37c91470 100644 --- a/pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs +++ b/pkgs/by-name/mp/mpdpopm/src/dj/algorithms.rs @@ -21,11 +21,6 @@ impl Algorithm for Discovery { async fn next_track(&mut self, client: &mut Client) -> Result<String> { macro_rules! take { ($first:expr, $second:expr, $third:expr) => {{ - tracing::info!( - "Selecting a `{}` track for the next entry in the queue", - stringify!($first) - ); - $first.pop().map_or_else( || { $second.pop().map_or_else( @@ -36,13 +31,31 @@ impl Algorithm for Discovery { "This means that there are no songs in the libary" ) }, - Ok::<_, anyhow::Error>, + |val| { + tracing::info!( + "Selecting a `{}` track for the next entry in the queue", + stringify!($third) + ); + Ok::<_, anyhow::Error>(val) + }, ) }, - Ok::<_, anyhow::Error>, + |val| { + tracing::info!( + "Selecting a `{}` track for the next entry in the queue", + stringify!($second) + ); + Ok::<_, anyhow::Error>(val) + }, ) }, - Ok::<_, anyhow::Error>, + |val| { + tracing::info!( + "Selecting a `{}` track for the next entry in the queue", + stringify!($first) + ); + Ok::<_, anyhow::Error>(val) + }, ) }}; } |
