diff --git a/src/gui/mdb-imdb.cpp b/src/gui/mdb-imdb.cpp index 998419433..01cb0ddd2 100644 --- a/src/gui/mdb-imdb.cpp +++ b/src/gui/mdb-imdb.cpp @@ -28,35 +28,18 @@ #include #include +#include + #include #include #include #include #include #include -#include #include #include "mdb-imdb.h" - -CIMDB::CIMDB() -{ - search_url = "http://www.google.de/search?q="; - search_outfile = "/tmp/google.out"; - search_error = "IMDb: Google download failed"; - imdb_url = "http://www.omdbapi.com/?plot=full&r=json&i="; - imdb_outfile = "/tmp/imdb.json"; - posterfile = "/tmp/imdb.jpg"; - - acc = 0; -} - -CIMDB::~CIMDB() -{ - cleanup(); -} - CIMDB* CIMDB::getInstance() { static CIMDB* imdb = NULL; @@ -65,11 +48,22 @@ CIMDB* CIMDB::getInstance() return imdb; } -inline std::string CIMDB::getApiKey() +CIMDB::CIMDB() { - std::string ret = "&apikey="; - ret += g_settings.omdb_api_key; - return ret; + key = g_settings.omdb_api_key; + search_url = "http://www.google.de/search?q="; + search_outfile = "/tmp/google.out"; + search_error = "IMDb: Google download failed"; + imdb_url = "http://www.omdbapi.com/?plot=full&r=json&apikey=" + key + "&i="; + imdb_outfile = "/tmp/imdb.json"; + posterfile = "/tmp/imdb.jpg"; + + acc = 0; +} + +CIMDB::~CIMDB() +{ + cleanup(); } std::string CIMDB::utf82url(std::string s) @@ -315,7 +309,7 @@ int CIMDB::getIMDb(const std::string& epgTitle) if(((imdb_id.find(search_error)) != std::string::npos)) return ret; - std::string url = imdb_url + imdb_id + getApiKey(); + std::string url = imdb_url + imdb_id; if (httpTool.downloadFile(url, imdb_outfile.c_str())) { diff --git a/src/gui/mdb-imdb.h b/src/gui/mdb-imdb.h index db51a123c..90b2a4b97 100644 --- a/src/gui/mdb-imdb.h +++ b/src/gui/mdb-imdb.h @@ -56,6 +56,7 @@ class CIMDB private: int acc; std::string imdb_url; + std::string key; // omdb api key std::string googleIMDb(std::string s); std::string utf82url(std::string s); diff --git a/src/gui/mdb-tmdb.cpp b/src/gui/mdb-tmdb.cpp index 296527d79..2a5c31f12 100644 --- a/src/gui/mdb-tmdb.cpp +++ b/src/gui/mdb-tmdb.cpp @@ -24,26 +24,22 @@ #include #endif +#include +#include +#include + #include #include #include #include #include #include -#include - -#include -#include #include - -#include "system/settings.h" -#include "system/set_threadname.h" - +#include +#include #include - #include - #include "mdb-tmdb.h" CTMDB* CTMDB::getInstance() @@ -56,11 +52,7 @@ CTMDB* CTMDB::getInstance() CTMDB::CTMDB() { -#ifdef TMDB_API_KEY - key = TMDB_API_KEY; -#else key = g_settings.tmdb_api_key; -#endif hintbox = NULL; } diff --git a/src/gui/mdb-tmdb.h b/src/gui/mdb-tmdb.h index 90482b1b9..9f06e4fde 100644 --- a/src/gui/mdb-tmdb.h +++ b/src/gui/mdb-tmdb.h @@ -23,9 +23,9 @@ #define __tmdb__ #include -#include "system/helpers.h" +#include #include -#include "gui/widget/hintbox.h" +#include #define TMDB_COVER "/tmp/tmdb.jpg"