From d43e4912ce80b8ad7040e2ed58f7b5e0971a8935 Mon Sep 17 00:00:00 2001 From: BPanther Date: Thu, 2 May 2019 20:55:51 +0200 Subject: [PATCH] fix tmdb cover in moviebrowser Signed-off-by: GetAway --- src/gui/moviebrowser/mb.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 1e6361788..cc1de4d09 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -88,6 +88,8 @@ typedef struct dirent64 dirent_struct; #define my_stat stat64 #define TRACE printf +cTmdb* tmdb; + #define NUMBER_OF_MOVIES_LAST 40 // This is the number of movies shown in last recored and last played list #define MOVIE_SMSKEY_TIMEOUT 800 @@ -271,6 +273,9 @@ CMovieBrowser::~CMovieBrowser() if (m_header) delete m_header; + + if (tmdb) + delete tmdb; } void CMovieBrowser::clearListLines() @@ -428,6 +433,7 @@ void CMovieBrowser::init(void) m_doRefresh = false; m_doLoadMovies = false; + tmdb = cTmdb::getInstance(); imdb = CIMDB::getInstance(); } @@ -2070,15 +2076,12 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) extension = "." + extension; str_replace(extension, ".jpg", cover_file); printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),cover_file.c_str()); - cTmdb* tmdb = cTmdb::getInstance(); tmdb->setTitle(m_movieSelectionHandler->epgTitle); if ((tmdb->getResults() > 0) && (tmdb->hasCover())) { if (!cover_file.empty()) if (tmdb->getSmallCover(cover_file)) refresh(); } - if (tmdb) - delete tmdb; } } }