def getMovieInfo( self, refresh=False ): try: if self.movie: self.moviethumb = self.movie[ "thumbnail" ] self.moviefanart = self.movie[ "fanart" ] self.library = False self.online_info = "http://www.themoviedb.org/movie/%s?language=%s" % ( self.movieid.replace( "idTMDB=", "" ), ADDON.getSetting( "language" ).lower() ) elif "idTMDB" in self.movieid: self.allow_refresh = True movieid = self.movieid.replace( "idTMDB=", "" ) self.movie = tmdbAPI.load_movie_info( movieid ) if refresh or not self.movie: xbmc.executebuiltin( 'ActivateWindow(busydialog)' ) js, lang = tmdbAPI.get_movie( movieid, ADDON.getSetting( "language" ).lower() ) self.movie = tmdbAPI.save_movie_info( js ) xbmc.executebuiltin( 'Dialog.Close(busydialog,true)' ) self.moviethumb = self.movie[ "thumbnail" ] self.moviefanart = self.movie[ "fanart" ] self.library = False self.online_info = "http://www.themoviedb.org/movie/%s?language=%s" % ( movieid, ADDON.getSetting( "language" ).lower() ) else: self.movie = metautils.get_library_movie_details( self.movieid ) self.moviefanart = self.movie[ "art" ].get( "fanart", "" ) self.moviethumb = self.movie[ "art" ].get( "poster", "" ) if self.moviethumb == "": self.moviethumb = self.movie[ "art" ].get( "thumb", "" ) self.online_info = "" self.library = True #print self.movie #s_json = metautils.json.dumps( details, sort_keys=True, indent=2 ) except: xbmc.executebuiltin( 'Dialog.Close(busydialog,true)' ) print_exc() raise
def load_movie_info( self, mid ): movie = False try: movieid = mid.replace( "idTMDB=", "" ) movie = tmdbAPI.load_movie_info( movieid ) if not movie: xbmc.executebuiltin( 'ActivateWindow(busydialog)' ) js, lang = tmdbAPI.get_movie( movieid, ADDON.getSetting( "language" ).lower() ) movie = tmdbAPI.save_movie_info( js ) xbmc.executebuiltin( 'Dialog.Close(busydialog,true)' ) except: xbmc.executebuiltin( 'Dialog.Close(busydialog,true)' ) print_exc() raise return movie
def getMovieInfo(self, refresh=False): try: if "idTMDB" in self.movieid: self.allow_refresh = True movieid = self.movieid.replace("idTMDB=", "") self.movie = tmdbAPI.load_movie_info(movieid) if refresh or not self.movie: xbmc.executebuiltin('ActivateWindow(busydialog)') js, lang = tmdbAPI.get_movie( movieid, ADDON.getSetting("language").lower()) self.movie = tmdbAPI.save_movie_info(js) xbmc.executebuiltin('Dialog.Close(busydialog,true)') self.online_info = "http://www.themoviedb.org/movie/%s?language=%s" % ( movieid, ADDON.getSetting("language").lower()) else: self.movie = metautils.get_library_movie_details(self.movieid) self.online_info = "" #print self.movie #s_json = metautils.json.dumps( details, sort_keys=True, indent=2 ) except: xbmc.executebuiltin('Dialog.Close(busydialog,true)') print_exc() raise