about summary refs log tree commit diff stats
path: root/pkgs/by-name/mp/mpdpopm/src/lib.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-01-27 18:59:49 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-01-27 18:59:49 +0100
commit75d5979ae5b71d79490c14313f7d25ef3685a21c (patch)
tree9872795a319fa1244d0d393d0269cf553c0c845f /pkgs/by-name/mp/mpdpopm/src/lib.rs
parentpkgs/mpp-lyrics: Account for different name for lyrics key in mp3 files (diff)
downloadnixos-config-75d5979ae5b71d79490c14313f7d25ef3685a21c.zip
pkgs/mpdpopm: Remove the whole message handling code
It is easier to handle the messages before sending them.
The only thing we lose is the ability to specify messages via external
clients.
Diffstat (limited to '')
-rw-r--r--pkgs/by-name/mp/mpdpopm/src/lib.rs43
1 files changed, 1 insertions, 42 deletions
diff --git a/pkgs/by-name/mp/mpdpopm/src/lib.rs b/pkgs/by-name/mp/mpdpopm/src/lib.rs
index 4fe523ea..7e1d3357 100644
--- a/pkgs/by-name/mp/mpdpopm/src/lib.rs
+++ b/pkgs/by-name/mp/mpdpopm/src/lib.rs
@@ -35,7 +35,6 @@
 pub mod clients;
 pub mod config;
 pub mod filters_ast;
-pub mod messages;
 pub mod playcounts;
 pub mod storage;
 pub mod vars;
@@ -53,7 +52,6 @@ use crate::{
     clients::{Client, IdleClient, IdleSubSystem},
     config::{Config, Connection},
     filters_ast::FilterStickerNames,
-    messages::MessageProcessor,
     playcounts::PlayState,
 };
 
@@ -110,12 +108,9 @@ pub async fn mpdpopm(cfg: Config) -> std::result::Result<(), Error> {
     let tick = sleep(Duration::from_millis(cfg.poll_interval_ms)).fuse();
     pin_mut!(ctrl_c, sighup, sigkill, tick);
 
-    let mproc = MessageProcessor::new();
-
     let mut done = false;
     while !done {
         debug!("selecting...");
-        let mut msg_check_needed = false;
         {
             // `idle_client' mutably borrowed here
             let mut idle = Box::pin(idle_client.idle().fuse());
@@ -142,24 +137,6 @@ pub async fn mpdpopm(cfg: Config) -> std::result::Result<(), Error> {
                                 .await
                                 .context("PlayState update failed")?
                     },
-                    // next = cmds.next() => match next {
-                    //     Some(out) => {
-                    //         debug!("output status is {:#?}", out.out);
-                    //         match out.upd {
-                    //             Some(uri) => {
-                    //                 debug!("{} needs to be updated", uri);
-                    //                 client.update(&uri).await.map_err(|err| Error::Client {
-                    //                     source: err,
-                    //                     back: Backtrace::new(),
-                    //                 })?;
-                    //             },
-                    //             None => debug!("No database update needed"),
-                    //         }
-                    //     },
-                    //     None => {
-                    //         debug!("No more commands to process.");
-                    //     }
-                    // },
                     res = idle => match res {
                         Ok(subsys) => {
                             debug!("subsystem {} changed", subsys);
@@ -168,7 +145,7 @@ pub async fn mpdpopm(cfg: Config) -> std::result::Result<(), Error> {
                                     .await
                                     .context("PlayState update failed")?
                             } else if subsys == IdleSubSystem::Message {
-                                msg_check_needed = true;
+                                error!("Message handling is not supported!");
                             }
                             break;
                         },
@@ -181,24 +158,6 @@ pub async fn mpdpopm(cfg: Config) -> std::result::Result<(), Error> {
                 }
             }
         }
-
-        if msg_check_needed {
-            // Check for any messages that have come in; if there's an error there's not a lot we
-            // can do about it (suppose some client fat-fingers a command name, e.g.)-- just log it
-            // & move on.
-            if let Err(err) = mproc
-                .check_messages(
-                    &mut client,
-                    &mut idle_client,
-                    state.last_status(),
-                    &cfg.commands_chan,
-                    &filter_stickers,
-                )
-                .await
-            {
-                error!("Error while processing messages: {err:#?}");
-            }
-        }
     }
 
     info!("mpdpopm exiting.");