rework tmdb class

Origin commit data
------------------
Branch: ni/coolstream
Commit: a633525ba2
Author: TangoCash <eric@loxat.de>
Date: 2019-03-03 (Sun, 03 Mar 2019)


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

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2019-03-03 22:20:23 +01:00
committed by vanhofen
parent d541e48e94
commit a9b3fd02c6
5 changed files with 47 additions and 148 deletions

View File

@@ -50,7 +50,6 @@
#include <gui/moviebrowser/mb.h>
#include <gui/movieplayer.h>
#include <gui/pictureviewer.h>
#include <gui/tmdb.h>
#include <driver/record.h>
#include <driver/fontrenderer.h>
@@ -59,8 +58,6 @@
#include <eitd/sectionsd.h>
#include <timerdclient/timerdclient.h>
#define TMDB_COVER "/tmp/tmdb.jpg"
extern CPictureViewer * g_PicViewer;
#define ICON_LARGE_WIDTH 26
@@ -125,7 +122,6 @@ CEpgData::CEpgData()
{
bigFonts = false;
frameBuffer = CFrameBuffer::getInstance();
tmdb_active = false;
mp_movie_info = NULL;
header = NULL;
Bottombox = NULL;
@@ -135,6 +131,8 @@ CEpgData::CEpgData()
imdb = CIMDB::getInstance();
imdb_active = false;
tmdb = cTmdb::getInstance();
tmdb_active = false;
movie_filename.clear();
}
@@ -244,7 +242,7 @@ void CEpgData::processTextToArray(std::string text, int screening, bool has_cove
void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear)
{
Font* font = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2];
std::string cover = "/tmp/tmdb.jpg"; //todo: maybe add a getCover()-function to tmdb class
std::string cover = tmdb->getCover();
int cover_max_width = ox/4; //25%
int cover_max_height = sb-(2*OFFSET_INNER_MID);
int cover_width = 0;
@@ -1192,7 +1190,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
{
showPos = 0;
if (!tmdb_active) {
cTmdb* tmdb = new cTmdb(epgData.title);
tmdb->setTitle(epgData.title);
if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) {
epgText_saved = epgText;
epgText.clear();
@@ -1209,7 +1207,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
} else {
ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMsgBox::mbrOk , CMsgBox::mbrOk);
}
delete tmdb;
} else {
epgText = epgText_saved;
textCount = epgText.size();
@@ -1414,7 +1411,9 @@ void CEpgData::hide()
imdb_active = false;
imdb->cleanup();
remove(TMDB_COVER);
// tmdb
tmdb_active = false;
tmdb->cleanup();
}
void CEpgData::GetEPGData(const t_channel_id channel_id, uint64_t id, time_t* startzeit, bool clear )