mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
tmdb: Use osd language for search & display data
Origin commit data
------------------
Commit: 11cdccac52
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-03-04 (Fri, 04 Mar 2016)
This commit is contained in:
@@ -73,7 +73,10 @@ cTmdb::cTmdb(std::string epgtitle)
|
|||||||
key = g_settings.tmdb_api_key;
|
key = g_settings.tmdb_api_key;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GetMovieDetails();
|
std::string lang = Lang2ISO639_1(g_settings.language);
|
||||||
|
GetMovieDetails(lang);
|
||||||
|
if ((minfo.result < 1 || minfo.overview.empty()) && lang != "en")
|
||||||
|
GetMovieDetails("en");
|
||||||
}
|
}
|
||||||
|
|
||||||
cTmdb::~cTmdb()
|
cTmdb::~cTmdb()
|
||||||
@@ -192,10 +195,10 @@ bool cTmdb::DownloadUrl(std::string url, std::string file, CURL *_curl_handle)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cTmdb::GetMovieDetails()
|
bool cTmdb::GetMovieDetails(std::string lang)
|
||||||
{
|
{
|
||||||
printf("[TMDB]: %s\n",__func__);
|
printf("[TMDB]: %s\n",__func__);
|
||||||
std::string url = "http://api.themoviedb.org/3/search/multi?api_key="+key+"&language=de&query=" + encodeUrl(minfo.epgtitle);
|
std::string url = "http://api.themoviedb.org/3/search/multi?api_key="+key+"&language="+lang+"&query=" + encodeUrl(minfo.epgtitle);
|
||||||
std::string answer;
|
std::string answer;
|
||||||
if (!getUrl(url, answer))
|
if (!getUrl(url, answer))
|
||||||
return false;
|
return false;
|
||||||
@@ -218,7 +221,7 @@ bool cTmdb::GetMovieDetails()
|
|||||||
minfo.id = elements[0].get("id",-1).asInt();
|
minfo.id = elements[0].get("id",-1).asInt();
|
||||||
minfo.media_type = elements[0].get("media_type","").asString();
|
minfo.media_type = elements[0].get("media_type","").asString();
|
||||||
if (minfo.id > -1) {
|
if (minfo.id > -1) {
|
||||||
url = "http://api.themoviedb.org/3/"+minfo.media_type+"/"+to_string(minfo.id)+"?api_key="+key+"&language=de&append_to_response=credits";
|
url = "http://api.themoviedb.org/3/"+minfo.media_type+"/"+to_string(minfo.id)+"?api_key="+key+"&language="+lang+"&append_to_response=credits";
|
||||||
answer.clear();
|
answer.clear();
|
||||||
if (!getUrl(url, answer))
|
if (!getUrl(url, answer))
|
||||||
return false;
|
return false;
|
||||||
|
@@ -61,7 +61,7 @@ class cTmdb
|
|||||||
std::string key; // tmdb api key
|
std::string key; // tmdb api key
|
||||||
bool getUrl(std::string &url, std::string &answer, CURL *_curl_handle = NULL);
|
bool getUrl(std::string &url, std::string &answer, CURL *_curl_handle = NULL);
|
||||||
bool DownloadUrl(std::string url, std::string file, CURL *_curl_handle = NULL);
|
bool DownloadUrl(std::string url, std::string file, CURL *_curl_handle = NULL);
|
||||||
bool GetMovieDetails();
|
bool GetMovieDetails(std::string lang);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cTmdb(std::string epgtitle);
|
cTmdb(std::string epgtitle);
|
||||||
|
Reference in New Issue
Block a user