mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
- imdb/tmdb: more unifications
Origin commit data
------------------
Branch: ni/coolstream
Commit: a4c9df53a5
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-04-08 (Thu, 08 Apr 2021)
Origin message was:
------------------
- - imdb/tmdb: more unifications
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -62,11 +62,12 @@ libneutrino_gui_a_SOURCES = \
|
|||||||
filebrowser.cpp \
|
filebrowser.cpp \
|
||||||
followscreenings.cpp \
|
followscreenings.cpp \
|
||||||
imageinfo_ni.cpp \
|
imageinfo_ni.cpp \
|
||||||
imdb.cpp \
|
|
||||||
info_menue.cpp \
|
info_menue.cpp \
|
||||||
infoviewer.cpp \
|
infoviewer.cpp \
|
||||||
infoviewer_bb.cpp \
|
infoviewer_bb.cpp \
|
||||||
keybind_setup.cpp \
|
keybind_setup.cpp \
|
||||||
|
mdb-imdb.cpp \
|
||||||
|
mdb-tmdb.cpp \
|
||||||
mediaplayer.cpp \
|
mediaplayer.cpp \
|
||||||
mediaplayer_setup.cpp \
|
mediaplayer_setup.cpp \
|
||||||
miscsettings_menu.cpp \
|
miscsettings_menu.cpp \
|
||||||
@@ -102,7 +103,6 @@ libneutrino_gui_a_SOURCES = \
|
|||||||
subchannel_select.cpp \
|
subchannel_select.cpp \
|
||||||
themes.cpp \
|
themes.cpp \
|
||||||
timeosd.cpp \
|
timeosd.cpp \
|
||||||
tmdb.cpp \
|
|
||||||
update.cpp \
|
update.cpp \
|
||||||
update_check.cpp \
|
update_check.cpp \
|
||||||
update_menue.cpp \
|
update_menue.cpp \
|
||||||
|
@@ -133,7 +133,7 @@ CEpgData::CEpgData()
|
|||||||
|
|
||||||
imdb = CIMDB::getInstance();
|
imdb = CIMDB::getInstance();
|
||||||
imdb_active = false;
|
imdb_active = false;
|
||||||
tmdb = cTmdb::getInstance();
|
tmdb = CTMDB::getInstance();
|
||||||
tmdb_active = false;
|
tmdb_active = false;
|
||||||
movie_filename.clear();
|
movie_filename.clear();
|
||||||
}
|
}
|
||||||
|
@@ -35,8 +35,8 @@
|
|||||||
|
|
||||||
#include <system/settings.h>
|
#include <system/settings.h>
|
||||||
|
|
||||||
#include <gui/imdb.h>
|
#include <gui/mdb-imdb.h>
|
||||||
#include <gui/tmdb.h>
|
#include <gui/mdb-tmdb.h>
|
||||||
#include <driver/movieinfo.h>
|
#include <driver/movieinfo.h>
|
||||||
#include "widget/menue.h"
|
#include "widget/menue.h"
|
||||||
#include "widget/navibar.h"
|
#include "widget/navibar.h"
|
||||||
@@ -54,7 +54,7 @@ class CEpgData
|
|||||||
CChannelEventList followlist;
|
CChannelEventList followlist;
|
||||||
CEPGData epgData;
|
CEPGData epgData;
|
||||||
CIMDB *imdb;
|
CIMDB *imdb;
|
||||||
cTmdb *tmdb;
|
CTMDB *tmdb;
|
||||||
|
|
||||||
CComponentsHeader *header;
|
CComponentsHeader *header;
|
||||||
CNaviBar *Bottombox;
|
CNaviBar *Bottombox;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
imdb
|
Movie Database - OMDb/IMDb
|
||||||
|
|
||||||
(C) 2009-2016 NG-Team
|
(C) 2009-2016 NG-Team
|
||||||
(C) 2016 NI-Team
|
(C) 2016 NI-Team
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <json/json.h>
|
#include <json/json.h>
|
||||||
|
|
||||||
#include "imdb.h"
|
#include "mdb-imdb.h"
|
||||||
|
|
||||||
|
|
||||||
CIMDB::CIMDB()
|
CIMDB::CIMDB()
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
imdb
|
Movie Database - OMDb/IMDb
|
||||||
|
|
||||||
(C) 2009-2016 NG-Team
|
(C) 2009-2016 NG-Team
|
||||||
(C) 2016 NI-Team
|
(C) 2016 NI-Team
|
@@ -1,4 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
Movie Database - TMDb
|
||||||
|
|
||||||
Copyright (C) 2015-2020 TangoCash
|
Copyright (C) 2015-2020 TangoCash
|
||||||
|
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
@@ -42,17 +44,17 @@
|
|||||||
|
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
|
|
||||||
#include "tmdb.h"
|
#include "mdb-tmdb.h"
|
||||||
|
|
||||||
cTmdb* cTmdb::getInstance()
|
CTMDB* CTMDB::getInstance()
|
||||||
{
|
{
|
||||||
static cTmdb* tmdb = NULL;
|
static CTMDB* tmdb = NULL;
|
||||||
if(!tmdb)
|
if(!tmdb)
|
||||||
tmdb = new cTmdb();
|
tmdb = new CTMDB();
|
||||||
return tmdb;
|
return tmdb;
|
||||||
}
|
}
|
||||||
|
|
||||||
cTmdb::cTmdb()
|
CTMDB::CTMDB()
|
||||||
{
|
{
|
||||||
#ifdef TMDB_API_KEY
|
#ifdef TMDB_API_KEY
|
||||||
key = TMDB_API_KEY;
|
key = TMDB_API_KEY;
|
||||||
@@ -62,12 +64,12 @@ cTmdb::cTmdb()
|
|||||||
hintbox = NULL;
|
hintbox = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
cTmdb::~cTmdb()
|
CTMDB::~CTMDB()
|
||||||
{
|
{
|
||||||
cleanup();
|
cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cTmdb::setTitle(std::string epgtitle)
|
void CTMDB::setTitle(std::string epgtitle)
|
||||||
{
|
{
|
||||||
minfo.epgtitle = epgtitle;
|
minfo.epgtitle = epgtitle;
|
||||||
|
|
||||||
@@ -86,7 +88,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;
|
std::string answer;
|
||||||
if (!getUrl(url, answer))
|
if (!getUrl(url, answer))
|
||||||
@@ -102,7 +104,7 @@ bool cTmdb::GetData(std::string url, Json::Value *root)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cTmdb::GetMovieDetails(std::string lang, bool second)
|
bool CTMDB::GetMovieDetails(std::string lang, bool second)
|
||||||
{
|
{
|
||||||
printf("[TMDB]: %s\n",__func__);
|
printf("[TMDB]: %s\n",__func__);
|
||||||
Json::Value root;
|
Json::Value root;
|
||||||
@@ -189,7 +191,7 @@ bool cTmdb::GetMovieDetails(std::string lang, bool second)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cTmdb::CreateEPGText()
|
std::string CTMDB::CreateEPGText()
|
||||||
{
|
{
|
||||||
std::string epgtext("");
|
std::string epgtext("");
|
||||||
|
|
||||||
@@ -212,7 +214,7 @@ std::string cTmdb::CreateEPGText()
|
|||||||
return epgtext;
|
return epgtext;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cTmdb::CreateMovieText()
|
std::string CTMDB::CreateMovieText()
|
||||||
{
|
{
|
||||||
std::string movietext("");
|
std::string movietext("");
|
||||||
|
|
||||||
@@ -230,13 +232,13 @@ std::string cTmdb::CreateMovieText()
|
|||||||
return movietext;
|
return movietext;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cTmdb::cleanup()
|
void CTMDB::cleanup()
|
||||||
{
|
{
|
||||||
if (access(TMDB_COVER, F_OK) == 0)
|
if (access(TMDB_COVER, F_OK) == 0)
|
||||||
unlink(TMDB_COVER);
|
unlink(TMDB_COVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cTmdb::selectResult(Json::Value elements, int results, int &use_result)
|
void CTMDB::selectResult(Json::Value elements, int results, int &use_result)
|
||||||
{
|
{
|
||||||
if(hintbox){
|
if(hintbox){
|
||||||
hintbox->hide();
|
hintbox->hide();
|
@@ -1,4 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
Movie Database - TMDb
|
||||||
|
|
||||||
Copyright (C) 2015-2020 TangoCash
|
Copyright (C) 2015-2020 TangoCash
|
||||||
|
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
@@ -17,8 +19,8 @@
|
|||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __TMDB__
|
#ifndef __tmdb__
|
||||||
#define __TMDB__
|
#define __tmdb__
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "system/helpers.h"
|
#include "system/helpers.h"
|
||||||
@@ -46,7 +48,7 @@ typedef struct {
|
|||||||
std::string cast;
|
std::string cast;
|
||||||
}tmdbinfo;
|
}tmdbinfo;
|
||||||
|
|
||||||
class cTmdb
|
class CTMDB
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
tmdbinfo minfo;
|
tmdbinfo minfo;
|
||||||
@@ -57,9 +59,9 @@ class cTmdb
|
|||||||
void selectResult(Json::Value elements, int results, int &used_result);
|
void selectResult(Json::Value elements, int results, int &used_result);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cTmdb();
|
CTMDB();
|
||||||
~cTmdb();
|
~CTMDB();
|
||||||
static cTmdb* getInstance();
|
static CTMDB* getInstance();
|
||||||
void setTitle(std::string epgtitle);
|
void setTitle(std::string epgtitle);
|
||||||
std::string CreateEPGText();
|
std::string CreateEPGText();
|
||||||
std::string CreateMovieText();
|
std::string CreateMovieText();
|
@@ -51,7 +51,7 @@
|
|||||||
#include "mb_functions.h"
|
#include "mb_functions.h"
|
||||||
#include "mb_help.h"
|
#include "mb_help.h"
|
||||||
#include <gui/filebrowser.h>
|
#include <gui/filebrowser.h>
|
||||||
#include <gui/tmdb.h>
|
#include <gui/mdb-tmdb.h>
|
||||||
#include <gui/epgview.h>
|
#include <gui/epgview.h>
|
||||||
#include <gui/widget/hintbox.h>
|
#include <gui/widget/hintbox.h>
|
||||||
#include <gui/widget/icons.h>
|
#include <gui/widget/icons.h>
|
||||||
@@ -2170,7 +2170,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
|
|||||||
extension = "." + extension;
|
extension = "." + extension;
|
||||||
str_replace(extension, ".jpg", cover_file);
|
str_replace(extension, ".jpg", cover_file);
|
||||||
printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),cover_file.c_str());
|
printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),cover_file.c_str());
|
||||||
cTmdb* tmdb = cTmdb::getInstance();
|
CTMDB* tmdb = CTMDB::getInstance();
|
||||||
if (tmdb)
|
if (tmdb)
|
||||||
{
|
{
|
||||||
tmdb->setTitle(m_movieSelectionHandler->epgTitle);
|
tmdb->setTitle(m_movieSelectionHandler->epgTitle);
|
||||||
|
@@ -61,7 +61,7 @@
|
|||||||
#include <gui/widget/progresswindow.h>
|
#include <gui/widget/progresswindow.h>
|
||||||
#include <gui/widget/stringinput_ext.h>
|
#include <gui/widget/stringinput_ext.h>
|
||||||
#include <gui/widget/keyboard_input.h>
|
#include <gui/widget/keyboard_input.h>
|
||||||
#include <gui/imdb.h>
|
#include <gui/mdb-imdb.h>
|
||||||
|
|
||||||
#define MAX_NUMBER_OF_BOOKMARK_ITEMS MI_MOVIE_BOOK_USER_MAX // we just use the same size as used in Movie info (MAX_NUMBER_OF_BOOKMARK_ITEMS is used for the number of menu items)
|
#define MAX_NUMBER_OF_BOOKMARK_ITEMS MI_MOVIE_BOOK_USER_MAX // we just use the same size as used in Movie info (MAX_NUMBER_OF_BOOKMARK_ITEMS is used for the number of menu items)
|
||||||
#define MOVIEBROWSER_SETTINGS_FILE CONFIGDIR "/moviebrowser.conf"
|
#define MOVIEBROWSER_SETTINGS_FILE CONFIGDIR "/moviebrowser.conf"
|
||||||
|
Reference in New Issue
Block a user