mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-11 23:50:58 +02:00
imdb/tmdb: more unifications; function names
Origin commit data
------------------
Commit: cb0aeb2a02
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-04-08 (Thu, 08 Apr 2021)
Origin message was:
------------------
- imdb/tmdb: more unifications; function names
This commit is contained in:
@@ -70,9 +70,9 @@ void CTMDB::setTitle(std::string epgtitle)
|
||||
hintbox->paint();
|
||||
|
||||
std::string lang = Lang2ISO639_1(g_settings.language);
|
||||
GetMovieDetails(lang);
|
||||
getMovieDetails(lang);
|
||||
if ((minfo.result < 1 || minfo.overview.empty()) && lang != "en")
|
||||
GetMovieDetails("en", true);
|
||||
getMovieDetails("en", true);
|
||||
|
||||
if(hintbox){
|
||||
hintbox->hide();
|
||||
@@ -81,7 +81,7 @@ void CTMDB::setTitle(std::string epgtitle)
|
||||
}
|
||||
}
|
||||
|
||||
bool CTMDB::GetData(std::string url, Json::Value *root)
|
||||
bool CTMDB::getData(std::string url, Json::Value *root)
|
||||
{
|
||||
std::string answer;
|
||||
if (!getUrl(url, answer))
|
||||
@@ -97,13 +97,13 @@ bool CTMDB::GetData(std::string url, Json::Value *root)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CTMDB::GetMovieDetails(std::string lang, bool second)
|
||||
bool CTMDB::getMovieDetails(std::string lang, bool second)
|
||||
{
|
||||
printf("[TMDB]: %s\n",__func__);
|
||||
Json::Value root;
|
||||
const std::string urlapi = "http://api.themoviedb.org/3/";
|
||||
std::string url = urlapi + "search/multi?api_key="+key+"&language="+lang+"&query=" + encodeUrl(minfo.epgtitle);
|
||||
if(!(GetData(url, &root)))
|
||||
if(!(getData(url, &root)))
|
||||
return false;
|
||||
|
||||
minfo.result = root.get("total_results",0).asInt();
|
||||
@@ -115,7 +115,7 @@ bool CTMDB::GetMovieDetails(std::string lang, bool second)
|
||||
printf("[TMDB]: second try\n");
|
||||
title.replace(pos1, pos2-pos1+1, "");
|
||||
url = urlapi + "search/multi?api_key="+key+"&language="+lang+"&query=" + encodeUrl(title);
|
||||
if(!(GetData(url, &root)))
|
||||
if(!(getData(url, &root)))
|
||||
return false;
|
||||
|
||||
minfo.result = root.get("total_results",0).asInt();
|
||||
@@ -136,7 +136,7 @@ bool CTMDB::GetMovieDetails(std::string lang, bool second)
|
||||
}
|
||||
if (minfo.id > -1) {
|
||||
url = urlapi+minfo.media_type+"/"+to_string(minfo.id)+"?api_key="+key+"&language="+lang+"&append_to_response=credits";
|
||||
if(!(GetData(url, &root)))
|
||||
if(!(getData(url, &root)))
|
||||
return false;
|
||||
|
||||
minfo.overview = root.get("overview","").asString();
|
||||
|
Reference in New Issue
Block a user