コード例 #1
0
 def movie_context_menu(self, control_id):
     movie_id = self.FocusedItem(control_id).getProperty("id")
     dbid = self.FocusedItem(control_id).getVideoInfoTag().getDbId()
     options = [addon.LANG(32113)]
     if self.logged_in:
         options.append(addon.LANG(32083))
     selection = xbmcgui.Dialog().contextmenu(list=options)
     if selection == 0:
         rating = utils.input_userrating()
         tmdb.set_rating(media_type="movie",
                         media_id=movie_id,
                         rating=rating,
                         dbid=dbid)
         xbmc.sleep(2000)
         tmdb.extended_movie_info(movie_id=movie_id,
                                  dbid=dbid,
                                  cache_time=0)
     elif selection == 1:
         account_lists = tmdb.get_account_lists()
         if not account_lists:
             return False
         listitems = ["%s (%i)" % (i["name"], i["item_count"]) for i in account_lists]
         i = xbmcgui.Dialog().select(addon.LANG(32136), listitems)
         if i > -1:
             tmdb.change_list_status(list_id=account_lists[i]["id"],
                                     movie_id=movie_id,
                                     status=True)
コード例 #2
0
 def movie_context_menu(self, control_id):
     movie_id = self.FocusedItem(control_id).getProperty("id")
     dbid = self.FocusedItem(control_id).getVideoInfoTag().getDbId()
     options = [addon.LANG(32113)]
     if self.logged_in:
         options.append(addon.LANG(32083))
     selection = xbmcgui.Dialog().contextmenu(list=options)
     if selection == 0:
         rating = utils.input_userrating()
         tmdb.set_rating(media_type="movie",
                         media_id=movie_id,
                         rating=rating,
                         dbid=dbid)
         xbmc.sleep(2000)
         tmdb.extended_movie_info(movie_id=movie_id,
                                  dbid=dbid,
                                  cache_time=0)
     elif selection == 1:
         account_lists = tmdb.get_account_lists()
         if not account_lists:
             return False
         listitems = [
             "%s (%i)" % (i["name"], i["item_count"]) for i in account_lists
         ]
         i = xbmcgui.Dialog().select(addon.LANG(32136), listitems)
         if i > -1:
             tmdb.change_list_status(list_id=account_lists[i]["id"],
                                     movie_id=movie_id,
                                     status=True)
コード例 #3
0
		def __init__(self, *args, **kwargs):
			if Utils.NETFLIX_VIEW == 'true':
				super(DialogVideoInfo, self).__init__(*args, **kwargs)
				self.type = 'Movie'
				data = TheMovieDB.extended_movie_info(movie_id=kwargs.get('id'), dbid=self.dbid)
				if not data:
					return None
				self.info, self.data = data
				sets_thread = SetItemsThread(self.info['SetId'])
				sets_thread.start()
				if 'dbid' not in self.info:
					self.info['poster'] = Utils.get_file(self.info.get('poster', ''))
				sets_thread.join()
				self.setinfo = sets_thread.setinfo
				self.data['similar'] = [i for i in self.data['similar'] if i['id'] not in sets_thread.id_list]
				self.listitems = [
					(250, sets_thread.listitems),
					(1000, self.data['actors']),
					(750, Utils.merge_dict_lists(self.data['crew'])),
					(150, self.data['similar']),
					(550, self.data['studios']),
					(850, self.data['genres']),
					(1050, self.data['reviews']),
					(1250, self.data['images']),
					(1350, self.data['backdrops'])
					]
			else:
				super(DialogVideoInfo, self).__init__(*args, **kwargs)
				self.type = 'Movie'
				data = TheMovieDB.extended_movie_info(movie_id=kwargs.get('id'), dbid=self.dbid)
				if not data:
					return None
				self.info, self.data = data
				sets_thread = SetItemsThread(self.info['SetId'])
				filter_thread = ImageTools.FilterImageThread(self.info.get('thumb', ''), 25)
				for thread in [sets_thread, filter_thread]:
					thread.start()
				if 'dbid' not in self.info:
					self.info['poster'] = Utils.get_file(self.info.get('poster', ''))
				sets_thread.join()
				self.setinfo = sets_thread.setinfo
				self.data['similar'] = [i for i in self.data['similar'] if i['id'] not in sets_thread.id_list]
				filter_thread.join()
				self.info['ImageFilter'] = filter_thread.image
				self.info['ImageColor'] = filter_thread.imagecolor
				self.listitems = [
					(250, sets_thread.listitems),
					(150, self.data['similar']),
					(1150, self.data['videos']),
					(1000, self.data['actors']),
					(750, Utils.merge_dict_lists(self.data['crew'])),
					(550, self.data['studios']),
					(650, TheMovieDB.merge_with_cert_desc(self.data['releases'], 'movie')),
					(850, self.data['genres']),
					(1050, self.data['reviews']),
					(1250, self.data['images']),
					(1350, self.data['backdrops'])
					]
コード例 #4
0
 def __init__(self, *args, **kwargs):
     super(DialogMovieInfo, self).__init__(*args, **kwargs)
     data = tmdb.extended_movie_info(movie_id=kwargs.get('id'),
                                     dbid=kwargs.get('dbid'))
     if not data:
         return None
     self.info, self.lists, self.states = data
     sets_thread = SetItemsThread(self.info.get_property("set_id"))
     self.omdb_thread = utils.FunctionThread(
         function=omdb.get_movie_info,
         param=self.info.get_property("imdb_id"))
     self.omdb_thread.start()
     sets_thread.start()
     self.info.update_properties(imagetools.blur(
         self.info.get_art("thumb")))
     if not self.info.get_info("dbid"):
         self.info.set_art("poster",
                           utils.get_file(self.info.get_art("poster")))
     sets_thread.join()
     self.info.update_properties(
         {"set.%s" % k: v
          for k, v in list(sets_thread.setinfo.items())})
     set_ids = [item.get_property("id") for item in sets_thread.listitems]
     self.lists["similar"] = [
         i for i in self.lists["similar"]
         if i.get_property("id") not in set_ids
     ]
     self.lists["sets"] = sets_thread.listitems
コード例 #5
0
 def update_states(self):
     xbmc.sleep(2000)  # delay because MovieDB takes some time to update
     _, __, self.states = tmdb.extended_movie_info(
         movie_id=self.info.get_property("id"),
         dbid=self.dbid,
         cache_time=0)
     super(DialogMovieInfo, self).update_states()
コード例 #6
0
 def __init__(self, *args, **kwargs):
     super(DialogMovieInfo, self).__init__(*args, **kwargs)
     data = tmdb.extended_movie_info(movie_id=kwargs.get('id'),
                                     dbid=kwargs.get('dbid'))
     if not data:
         return None
     self.info, self.lists, self.states = data
     sets_thread = SetItemsThread(self.info.get_property("set_id"))
     self.omdb_thread = utils.FunctionThread(function=omdb.get_movie_info,
                                             param=self.info.get_property("imdb_id"))
     self.omdb_thread.start()
     sets_thread.start()
     self.info.update_properties(imagetools.blur(self.info.get_art("thumb")))
     if not self.info.get_info("dbid"):
         self.info.set_art("poster", utils.get_file(self.info.get_art("poster")))
     sets_thread.join()
     self.info.update_properties({"set.%s" % k: v for k, v in sets_thread.setinfo.iteritems()})
     set_ids = [item.get_property("id") for item in sets_thread.listitems]
     self.lists["similar"] = [i for i in self.lists["similar"] if i.get_property("id") not in set_ids]
     self.lists["sets"] = sets_thread.listitems
コード例 #7
0
 def update_states(self):
     xbmc.sleep(2000)  # delay because MovieDB takes some time to update
     _, __, self.states = tmdb.extended_movie_info(movie_id=self.info.get_property("id"),
                                                   dbid=self.dbid,
                                                   cache_time=0)
     super(DialogMovieInfo, self).update_states()