Revert suppression of output of all external commands
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user