diff --git a/src/command_ui.cc b/src/command_ui.cc index 2f44adc7..eff77382 100644 --- a/src/command_ui.cc +++ b/src/command_ui.cc @@ -175,7 +175,7 @@ as_boolean(const torrent::Object& rawArgs) { torrent::Object apply_not(rpc::target_type target, const torrent::Object& rawArgs) { - return (int64_t)as_boolean(rawArgs); + return (int64_t)!as_boolean(rawArgs); } torrent::Object diff --git a/src/core/view.cc b/src/core/view.cc index ab6814d5..0f4ca030 100644 --- a/src/core/view.cc +++ b/src/core/view.cc @@ -132,6 +132,9 @@ struct view_downloads_filter : std::unary_function { view_downloads_filter(const std::string& cmd) : m_command(cmd) {} bool operator () (Download* d1) const { + if (m_command.empty()) + return true; + try { torrent::Object result = rpc::parse_command_single(rpc::make_target(d1), m_command);