diff --git a/src/gui/imdb.cpp b/src/gui/imdb.cpp index 8c024e47d..acf60d035 100644 --- a/src/gui/imdb.cpp +++ b/src/gui/imdb.cpp @@ -17,8 +17,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ @@ -35,7 +34,7 @@ #include #include #include - +#include #include #include "imdb.h" @@ -50,6 +49,8 @@ CIMDB::CIMDB() imdb_outfile = "/tmp/imdb.json"; omdb_apikey = ""; posterfile = "/tmp/imdb.jpg"; + + acc = 0; } CIMDB::~CIMDB() @@ -86,8 +87,8 @@ std::string CIMDB::utf82url(std::string s) std::string CIMDB::parseString(std::string search1, std::string search2, std::string str) { std::string ret, search; - size_t pos_wildcard, pos_firstline, pos_search1, pos_search2; - pos_wildcard = pos_firstline = pos_search1 = pos_search2 = std::string::npos; + size_t pos_wildcard, pos_search1, pos_search2; + pos_wildcard = pos_search1 = pos_search2 = std::string::npos; if((pos_wildcard = search1.find('*')) != std::string::npos) { @@ -156,12 +157,12 @@ std::string CIMDB::parseString(std::string search1, std::string search2, std::st std::string CIMDB::parseFile(std::string search1, std::string search2, const char* file, std::string firstline, int line_offset) { - int line = 0; + acc = 0; std::ifstream fh; - std::string str, ret, search; - size_t pos_firstline, pos_search1, pos_search2; - pos_firstline = pos_search1 = pos_search2 = std::string::npos; + std::string str, ret; + size_t pos_firstline; + pos_firstline = std::string::npos; if(firstline.empty()) pos_firstline = 0; @@ -169,6 +170,7 @@ std::string CIMDB::parseFile(std::string search1, std::string search2, const cha fh.open(file, std::ios::in); if(fh.is_open()) { + int line = 0; while (!fh.eof()) { getline(fh, str); @@ -473,3 +475,8 @@ void CIMDB::cleanup() if (access(posterfile.c_str(), F_OK) == 0) unlink(posterfile.c_str()); } + +bool CIMDB::gotPoster() +{ + return (access(posterfile.c_str(), F_OK) == 0); +} diff --git a/src/gui/imdb.h b/src/gui/imdb.h index c6e5d952d..29825c0f4 100644 --- a/src/gui/imdb.h +++ b/src/gui/imdb.h @@ -17,17 +17,15 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifndef __imdb__ #define __imdb__ -#include -#include + #include class CIMDB @@ -50,7 +48,7 @@ class CIMDB void getIMDbData(std::string& txt); - bool gotPoster() { return (access(posterfile.c_str(), F_OK) == 0); }; + bool gotPoster(); bool checkIMDbElement(std::string element); //FIXME: what if m[element] doesn't exist?