diff --git a/NEWS b/NEWS index 9f6e4694..f0485ac5 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,12 @@ ncmpcpp-0.8 (????-??-??) * Configuration variable 'execute_on_player_state_change' was added. +ncmpcpp-0.7.5 (2016-08-17) +* Action chains can be now used for seeking. +* Fixed fetching artist info from last.fm. +* Default value of regular_expressions was changed from 'basic' to 'perl' to work around boost issue (#12222). +* Fixed crash occuring when searching backward in an empty list. + ncmpcpp 0.7.4 (2016-04-17) * Fetching lyrics from lyricwiki.org was fixed. * Configure script now continues without errors if ICU library was not found. diff --git a/doc/config b/doc/config index 3afbb760..db703c2a 100644 --- a/doc/config +++ b/doc/config @@ -437,7 +437,7 @@ # ## Available values: none, basic, extended, perl. ## -#regular_expressions = basic +#regular_expressions = perl # ## ## Note: If below is enabled, ncmpcpp will ignore leading diff --git a/src/actions.cpp b/src/actions.cpp index d63215c2..e14cbcad 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -2830,9 +2830,34 @@ void seek() int old_timeout = wFooter->getTimeout(); wFooter->setTimeout(BaseScreen::defaultWindowTimeout); - auto seekForward = &Actions::get(Actions::Type::SeekForward); - auto seekBackward = &Actions::get(Actions::Type::SeekBackward); - + // Accept single action of a given type or action chain for which all actions + // can be run and one of them is of the given type. This will still not work + // in some contrived cases, but allows for more flexibility than accepting + // single actions only. + auto hasRunnableAction = [](BindingsConfiguration::BindingIteratorPair &bindings, Actions::Type type) { + bool success = false; + for (auto binding = bindings.first; binding != bindings.second; ++binding) + { + auto &actions = binding->actions(); + for (const auto &action : actions) + { + if (action->canBeRun()) + { + if (action->type() == type) + success = true; + } + else + { + success = false; + break; + } + } + if (success) + break; + } + return success; + }; + SeekingInProgress = true; while (true) { @@ -2843,16 +2868,14 @@ void seek() : Config.seek_time; NC::Key::Type input = readKey(*wFooter); + auto k = Bindings.get(input); - if (k.first == k.second || !k.first->isSingle()) // no single action? - break; - auto a = k.first->action(); - if (a == seekForward) + if (hasRunnableAction(k, Actions::Type::SeekForward)) { if (songpos < Status::State::totalTime()) songpos = std::min(songpos + howmuch, Status::State::totalTime()); } - else if (a == seekBackward) + else if (hasRunnableAction(k, Actions::Type::SeekBackward)) { if (songpos > 0) { diff --git a/src/configuration.cpp b/src/configuration.cpp index c8fa609e..5b42aa70 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -196,8 +196,8 @@ bool configure(int argc, char **argv) { auto format = Format::parse(vm["current-song"].as(), Format::Flags::Tag); std::cout << Format::stringify(format, &s); - return false; } + return false; } // custom startup screen diff --git a/src/curl_handle.cpp b/src/curl_handle.cpp index 7c64308f..cdd90344 100644 --- a/src/curl_handle.cpp +++ b/src/curl_handle.cpp @@ -44,6 +44,8 @@ CURLcode Curl::perform(std::string &data, const std::string &URL, const std::str curl_easy_setopt(c, CURLOPT_WRITEDATA, &data); curl_easy_setopt(c, CURLOPT_CONNECTTIMEOUT, timeout); curl_easy_setopt(c, CURLOPT_NOSIGNAL, 1); + // Workaround last.fm SSL certificate problems. + curl_easy_setopt(c, CURLOPT_SSL_VERIFYHOST, 0); curl_easy_setopt(c, CURLOPT_USERAGENT, "ncmpcpp " VERSION); if (follow_redirect) curl_easy_setopt(c, CURLOPT_FOLLOWLOCATION, 1L); diff --git a/src/helpers.h b/src/helpers.h index 19d66b53..c4e5123e 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -35,6 +35,11 @@ template Iterator wrappedSearch(Iterator begin, Iterator current, Iterator end, const PredicateT &pred, bool wrap, bool skip_current) { + if (begin == end) + { + assert(current == end); + return begin; + } if (skip_current) ++current; auto it = std::find_if(current, end, pred); diff --git a/src/settings.cpp b/src/settings.cpp index bbc1e382..d1bbdc14 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -596,7 +596,7 @@ bool Configuration::read(const std::vector &config_paths, bool igno else throw std::runtime_error("invalid argument: " + v); regex_type |= boost::regex::icase; - }, defaults_to(regex_type, boost::regex::basic | boost::regex::icase) + }, defaults_to(regex_type, boost::regex::perl | boost::regex::icase) )); p.add("ignore_leading_the", yes_no( ignore_leading_the, false