mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-03 10:51:12 +02:00
yt: make search order selectable
This commit is contained in:
@@ -1456,6 +1456,11 @@ typedef enum
|
||||
LOCALE_MOVIEBROWSER_YT_MOST_SHARED,
|
||||
LOCALE_MOVIEBROWSER_YT_NEXT_RESULTS,
|
||||
LOCALE_MOVIEBROWSER_YT_ON_THE_WEB,
|
||||
LOCALE_MOVIEBROWSER_YT_ORDERBY,
|
||||
LOCALE_MOVIEBROWSER_YT_ORDERBY_PUBLISHED,
|
||||
LOCALE_MOVIEBROWSER_YT_ORDERBY_RATING,
|
||||
LOCALE_MOVIEBROWSER_YT_ORDERBY_RELEVANCE,
|
||||
LOCALE_MOVIEBROWSER_YT_ORDERBY_VIEWCOUNT,
|
||||
LOCALE_MOVIEBROWSER_YT_PREF_QUALITY,
|
||||
LOCALE_MOVIEBROWSER_YT_PREV_RESULTS,
|
||||
LOCALE_MOVIEBROWSER_YT_RECENTLY_FEATURED,
|
||||
|
@@ -1456,6 +1456,11 @@ const char * locale_real_names[] =
|
||||
"moviebrowser.yt_most_shared",
|
||||
"moviebrowser.yt_next_results",
|
||||
"moviebrowser.yt_on_the_web",
|
||||
"moviebrowser.yt_orderby",
|
||||
"moviebrowser.yt_orderby.published",
|
||||
"moviebrowser.yt_orderby.rating",
|
||||
"moviebrowser.yt_orderby.relevance",
|
||||
"moviebrowser.yt_orderby.viewcount",
|
||||
"moviebrowser.yt_pref_quality",
|
||||
"moviebrowser.yt_prev_results",
|
||||
"moviebrowser.yt_recently_featured",
|
||||
|
@@ -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;
|
||||
|
@@ -129,10 +129,17 @@ class cYTFeedParser
|
||||
SEARCH,
|
||||
MODE_LAST
|
||||
};
|
||||
enum yt_feed_orderby_t
|
||||
{
|
||||
ORDERBY_PUBLISHED = 0,
|
||||
ORDERBY_RELEVANCE,
|
||||
ORDERBY_VIEWCOUNT,
|
||||
ORDERBY_RATING
|
||||
};
|
||||
cYTFeedParser();
|
||||
~cYTFeedParser();
|
||||
|
||||
bool ParseFeed(yt_feed_mode_t mode = MOST_POPULAR, std::string search = "", std::string vid = "");
|
||||
bool ParseFeed(yt_feed_mode_t mode = MOST_POPULAR, std::string search = "", std::string vid = "", yt_feed_orderby_t orderby = ORDERBY_PUBLISHED);
|
||||
bool ParseVideoInfo(cYTVideoInfo &vinfo, CURL *_curl_handle = NULL);
|
||||
bool DownloadThumbnail(cYTVideoInfo &vinfo, CURL *_curl_handle = NULL);
|
||||
bool GetVideoUrls();
|
||||
|
Reference in New Issue
Block a user