yt: make search order selectable

This commit is contained in:
martii
2013-10-06 12:11:20 +02:00
committed by Jacek Jendrzej
parent 60705383eb
commit fd5f9f118d
8 changed files with 47 additions and 3 deletions

View File

@@ -472,7 +472,7 @@ bool cYTFeedParser::ParseFeed(std::string &url)
return parseFeedXml(answer);
}
bool cYTFeedParser::ParseFeed(yt_feed_mode_t mode, std::string search, std::string vid)
bool cYTFeedParser::ParseFeed(yt_feed_mode_t mode, std::string search, std::string vid, yt_feed_orderby_t orderby)
{
std::string url = "http://gdata.youtube.com/feeds/api/standardfeeds/";
bool append_res = true;
@@ -540,6 +540,8 @@ bool cYTFeedParser::ParseFeed(yt_feed_mode_t mode, std::string search, std::stri
url = "http://gdata.youtube.com/feeds/api/videos?q=";
url += search;
url += "&";
const char *orderby_values[] = { "published", "relevance", "viewCount", "rating" };
url += "orderby=" + std::string(orderby_values[orderby & 3]) + "&";
}
feedmode = mode;