imdb/tmdb: more unifications; setTitle()

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

Origin message was:
------------------
- imdb/tmdb: more unifications; setTitle()

------------------
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 249c1d6aca
commit 54552558ce
10 changed files with 31 additions and 19 deletions

View File

@@ -1083,6 +1083,7 @@ imdb.data_website Webseite
imdb.data_writer Drehbuchautor imdb.data_writer Drehbuchautor
imdb.info IMDb-Info imdb.info IMDb-Info
imdb.info_save Bild speichern imdb.info_save Bild speichern
imdb.read_data Suche IMDb-Daten ...
inetradio.name Internetradio inetradio.name Internetradio
inetradio_autostart Internetradio Auto-Start inetradio_autostart Internetradio Auto-Start
infoicons_background Hintergrund anzeigen infoicons_background Hintergrund anzeigen

View File

@@ -1083,6 +1083,7 @@ imdb.data_website Website
imdb.data_writer Screenplay author imdb.data_writer Screenplay author
imdb.info IMDb-Info imdb.info IMDb-Info
imdb.info_save save Cover imdb.info_save save Cover
imdb.read_data Search IMDb data ...
inetradio.name Internetradio inetradio.name Internetradio
inetradio_autostart Internetradio auto-start inetradio_autostart Internetradio auto-start
infoicons_background Show background infoicons_background Show background

View File

@@ -1228,8 +1228,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
{ {
//show IMDb info //show IMDb info
imdb_active = true; imdb_active = true;
showIMDb(true); //show splashscreen only imdb->setTitle(epgData.title);
imdb->getMovieDetails(epgData.title);
showIMDb(); showIMDb();
showTimerEventBar(true, !mp_info && isCurrentEPG(channel_id), mp_info); //show buttons showTimerEventBar(true, !mp_info && isCurrentEPG(channel_id), mp_info); //show buttons
timeoutEnd = CRCInput::calcTimeoutEnd(timeout); timeoutEnd = CRCInput::calcTimeoutEnd(timeout);
@@ -1669,17 +1668,8 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info)
} }
//imdb start //imdb start
int CEpgData::showIMDb(bool splash) int CEpgData::showIMDb()
{ {
fontIMDb = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1];
frameBuffer->paintBoxRel(sx, sy+toph, ox /*- 15*/, sb, COL_MENUCONTENT_PLUS_0);
if (splash)
{
fontIMDb->RenderString(sx+OFFSET_INNER_MID, sy+toph+medlineheight, ox-OFFSET_INNER_MID, "IMDb: Daten werden geladen ...", COL_MENUCONTENT_TEXT, 0, true);
return 0;
}
//title //title
std::string title = imdb->getIMDbElement("Title"); std::string title = imdb->getIMDbElement("Title");

View File

@@ -107,7 +107,7 @@ class CEpgData
std::string imdb_rating; std::string imdb_rating;
std::string epg_title; std::string epg_title;
std::string movie_filename; std::string movie_filename;
int showIMDb(bool splash = false); int showIMDb();
Font *fontIMDb; Font *fontIMDb;
public: public:

View File

@@ -51,6 +51,7 @@ CIMDB *CIMDB::getInstance()
CIMDB::CIMDB() CIMDB::CIMDB()
{ {
key = g_settings.omdb_api_key; key = g_settings.omdb_api_key;
hintbox = NULL;
search_url = "http://www.google.de/search?q="; search_url = "http://www.google.de/search?q=";
search_outfile = "/tmp/google.out"; search_outfile = "/tmp/google.out";
search_error = "IMDb: Google download failed"; search_error = "IMDb: Google download failed";
@@ -66,6 +67,21 @@ CIMDB::~CIMDB()
cleanup(); cleanup();
} }
void CIMDB::setTitle(std::string epgtitle)
{
hintbox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_IMDB_READ_DATA);
hintbox->paint();
getMovieDetails(epgtitle);
if (hintbox)
{
hintbox->hide();
delete hintbox;
hintbox = NULL;
}
}
std::string CIMDB::utf82url(std::string s) std::string CIMDB::utf82url(std::string s)
{ {
std::stringstream ss; std::stringstream ss;

View File

@@ -26,10 +26,12 @@
#include <system/helpers.h> #include <system/helpers.h>
#include <zapit/zapit.h> #include <zapit/zapit.h>
#include <gui/widget/hintbox.h>
class CIMDB class CIMDB
{ {
private: private:
CHintBox *hintbox;
int acc; int acc;
std::string imdb_url; std::string imdb_url;
std::string key; // omdb api key std::string key; // omdb api key
@@ -46,6 +48,9 @@ class CIMDB
CIMDB(); CIMDB();
~CIMDB(); ~CIMDB();
static CIMDB *getInstance(); static CIMDB *getInstance();
void setTitle(std::string epgtitle);
std::string getEPGText();
std::string getMovieText();
std::string search_url; std::string search_url;
std::string search_outfile; std::string search_outfile;
@@ -58,9 +63,6 @@ class CIMDB
void StringReplace(std::string &str, const std::string search, const std::string rstr); void StringReplace(std::string &str, const std::string search, const std::string rstr);
void cleanup(); void cleanup();
std::string getEPGText();
std::string getMovieText();
std::string getPoster() { return posterfile; } std::string getPoster() { return posterfile; }
bool hasPoster() { return (access(posterfile.c_str(), F_OK) == 0); } bool hasPoster() { return (access(posterfile.c_str(), F_OK) == 0); }

View File

@@ -66,7 +66,7 @@ void CTMDB::setTitle(std::string epgtitle)
{ {
minfo.epgtitle = epgtitle; minfo.epgtitle = epgtitle;
hintbox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_TMDB_READ_DATA)); hintbox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_TMDB_READ_DATA);
hintbox->paint(); hintbox->paint();
std::string lang = Lang2ISO639_1(g_settings.language); std::string lang = Lang2ISO639_1(g_settings.language);

View File

@@ -1110,6 +1110,7 @@ typedef enum
LOCALE_IMDB_DATA_WRITER, LOCALE_IMDB_DATA_WRITER,
LOCALE_IMDB_INFO, LOCALE_IMDB_INFO,
LOCALE_IMDB_INFO_SAVE, LOCALE_IMDB_INFO_SAVE,
LOCALE_IMDB_READ_DATA,
LOCALE_INETRADIO_NAME, LOCALE_INETRADIO_NAME,
LOCALE_INETRADIO_AUTOSTART, LOCALE_INETRADIO_AUTOSTART,
LOCALE_INFOICONS_BACKGROUND, LOCALE_INFOICONS_BACKGROUND,

View File

@@ -1110,6 +1110,7 @@ const char * locale_real_names[] =
"imdb.data_writer", "imdb.data_writer",
"imdb.info", "imdb.info",
"imdb.info_save", "imdb.info_save",
"imdb.read_data",
"inetradio.name", "inetradio.name",
"inetradio_autostart", "inetradio_autostart",
"infoicons_background", "infoicons_background",