From dd0eac69f8bc58e5ce8c604aaa2b5b54ec68d8cf Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 3 Jan 2021 17:53:39 +0100 Subject: [PATCH] Revert suppression of output of all external commands --- CHANGELOG.md | 4 ++++ src/macro_utilities.cpp | 9 ++++----- src/macro_utilities.h | 2 +- src/screens/lyrics.cpp | 2 +- src/status.cpp | 4 ++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f6dd2ad..206ceb05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# ncmpcpp-0.9.2 (????-??-??) +* Revert suppression of output of all external commands as that makes e.g album + art addons no longer work. + # ncmpcpp-0.9.1 (2020-12-23) * Add support for fetching lyrics from musixmatch.com. * Fix intermittent failures of the Genius fetcher. diff --git a/src/macro_utilities.cpp b/src/macro_utilities.cpp index 88c3c923..4e3c5108 100644 --- a/src/macro_utilities.cpp +++ b/src/macro_utilities.cpp @@ -87,7 +87,7 @@ RunExternalCommand::RunExternalCommand(std::string &&command) void RunExternalCommand::run() { - runExternalCommandNoOutput(m_command, false); + runExternalCommand(m_command, false); } RunExternalConsoleCommand::RunExternalConsoleCommand(std::string &&command) @@ -113,11 +113,10 @@ void runExternalConsoleCommand(const std::string &cmd) NC::unpauseScreen(); } -void runExternalCommandNoOutput(const std::string &cmd, bool block) +void runExternalCommand(const std::string &cmd, bool block) { if (block) - std::system((cmd + " >/dev/null 2>&1").c_str()); + std::system(cmd.c_str()); else - std::system(("nohup " + cmd + " >/dev/null 2>&1 &").c_str()); - + std::system(("nohup " + cmd + " &").c_str()); } diff --git a/src/macro_utilities.h b/src/macro_utilities.h index 0dc34dd5..1850c299 100644 --- a/src/macro_utilities.h +++ b/src/macro_utilities.h @@ -85,6 +85,6 @@ private: // Helpers void runExternalConsoleCommand(const std::string &cmd); -void runExternalCommandNoOutput(const std::string &cmd, bool block); +void runExternalCommand(const std::string &cmd, bool block); #endif // NCMPCPP_MACRO_UTILITIES_H diff --git a/src/screens/lyrics.cpp b/src/screens/lyrics.cpp index 17754e97..d34ba617 100644 --- a/src/screens/lyrics.cpp +++ b/src/screens/lyrics.cpp @@ -332,7 +332,7 @@ void Lyrics::edit() fetch(m_song); } else - runExternalCommandNoOutput(Config.external_editor + " '" + filename + "'", false); + runExternalCommand(Config.external_editor + " '" + filename + "'", false); } void Lyrics::toggleFetcher() diff --git a/src/status.cpp b/src/status.cpp index 28e783c9..adbdc1a3 100644 --- a/src/status.cpp +++ b/src/status.cpp @@ -492,7 +492,7 @@ void Status::Changes::playerState() }; setenv("MPD_PLAYER_STATE", stateToEnv(m_player_state), 1); // Since we're setting a MPD_PLAYER_STATE, we need to block. - runExternalCommandNoOutput(Config.execute_on_player_state_change, true); + runExternalCommand(Config.execute_on_player_state_change, true); unsetenv("MPD_PLAYER_STATE"); } @@ -570,7 +570,7 @@ void Status::Changes::songID(int song_id) if (!s.empty()) { if (!Config.execute_on_song_change.empty()) - runExternalCommandNoOutput(Config.execute_on_song_change, false); + runExternalCommand(Config.execute_on_song_change, false); if (Config.fetch_lyrics_in_background) myLyrics->fetchInBackground(s, false);