epgview: more imdb/tmdb unifications

Origin commit data
------------------
Branch: ni/coolstream
Commit: 7f42e3ead6
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-05-03 (Mon, 03 May 2021)

Origin message was:
------------------
- epgview: more imdb/tmdb unifications

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2021-05-03 01:00:35 +02:00
parent b57ec6a248
commit ab9d3031a2
2 changed files with 70 additions and 69 deletions

View File

@@ -1183,8 +1183,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
break;
case CRCInput::RC_0: //tmdb
{
if (imdb_active) {
if (imdb_active)
{
imdb_active = false;
imdb_stars = 0;
showTimerEventBar(true, !mp_info && isCurrentEPG(channel_id), mp_info); //show buttons
epgText = epgText_saved;
textCount = epgText.size();
@@ -1192,25 +1194,30 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
if (g_settings.tmdb_enabled)
{
showPos = 0;
if (!tmdb_active) {
if (!tmdb_active)
{
tmdb->setTitle(epgData.title);
if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) {
if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty()))
{
tmdb_active = true;
tmdb_stars = tmdb->getStars();
epgText_saved = epgText;
epgText.clear();
tmdb_active = true;
epgTextSwitch = tmdb->getMovieText();
processTextToArray(tmdb->getEPGText(), 0, tmdb->hasPoster());
textCount = epgText.size();
tmdb_stars = tmdb->getStars();
showText(showPos, sy + toph, tmdb->hasPoster());
} else {
timeoutEnd = CRCInput::calcTimeoutEnd(timeout);
}
else
ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMsgBox::mbrOk , CMsgBox::mbrOk);
}
} else {
else
{
tmdb_active = false;
tmdb_stars = 0;
epgText = epgText_saved;
textCount = epgText.size();
tmdb_active = false;
tmdb_stars=0;
showText(showPos, sy + toph);
}
}
@@ -1218,21 +1225,35 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
}
case CRCInput::RC_green:
{
if (tmdb_active) {
if (tmdb_active)
{
tmdb_active = false;
tmdb_stars = 0;
epgText = epgText_saved;
textCount = epgText.size();
tmdb_stars=0;
}
if (g_settings.omdb_enabled)
{
showPos = 0;
if (!imdb_active)
{
//show IMDb info
imdb_active = true;
imdb->setTitle(epgData.title);
showIMDb();
if (((imdb->getIMDbElement("Title").find(imdb->search_error)) == std::string::npos))
{
imdb_active = true;
imdb_stars = imdb->getStars();
epgText_saved = epgText;
epgText.clear();
epgTextSwitch = imdb->getMovieText();
processTextToArray(imdb->getEPGText(), 0, imdb->hasPoster());
textCount = epgText.size();
showText(0, sy + toph, imdb->hasPoster());
showTimerEventBar(true, !mp_info && isCurrentEPG(channel_id), mp_info); //show buttons
timeoutEnd = CRCInput::calcTimeoutEnd(timeout);
}
else
ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMsgBox::mbrOk , CMsgBox::mbrOk);
}
else if (imdb_active && imdb->hasPoster())
{
imdb_active = false;
@@ -1257,6 +1278,15 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
hintBox->hide();
showTimerEventBar(true, !mp_info && isCurrentEPG(channel_id), mp_info); //show buttons
}
else
{
imdb_active = false;
imdb_stars = 0;
epgText = epgText_saved;
textCount = epgText.size();
showText(showPos, sy + toph);
}
}
break;
}
case CRCInput::RC_yellow:
@@ -1667,32 +1697,6 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info)
}
}
//imdb start
int CEpgData::showIMDb()
{
//title
std::string title = imdb->getIMDbElement("Title");
if(((title.find(imdb->search_error)) != std::string::npos))
return 1;
// clear epg array
epgText_saved = epgText;
epgText.clear();
//data
epgTextSwitch = imdb->getMovieText();
processTextToArray(imdb->getEPGText(), 0, imdb->hasPoster());
textCount = epgText.size();
//rating
imdb_stars = imdb->getStars();
showText(0, sy + toph, imdb->hasPoster());
return 0;
}
void CEpgData::ResetModules()
{
if (header){

View File

@@ -101,14 +101,11 @@ class CEpgData
void showProgressBar();
bool isCurrentEPG(const t_channel_id channel_id);
bool imdb_active;
int imdb_stars;
std::string imdb_rating;
std::string epg_title;
std::string movie_filename;
int showIMDb();
Font *fontIMDb;
public: