def context_menu(self, control_id):
     item_id = self.FocusedItem(control_id).getProperty("id")
     media_type = self.FocusedItem(control_id).getVideoInfoTag().getMediaType()
     listitems = [addon.LANG(32169)] if media_type == "tvshow" else [addon.LANG(32113)]
     if self.logged_in:
         listitems += [addon.LANG(14076)]
         if not self.type == "tv":
             listitems += [addon.LANG(32107)]
         if self.mode == "list":
             listitems += [addon.LANG(32035)]
     selection = xbmcgui.Dialog().contextmenu(list=listitems)
     if selection == 0:
         rating = utils.input_userrating()
         if tmdb.set_rating(media_type="tv" if media_type == "tvshow" else "movie",
                            media_id=item_id,
                            rating=rating,
                            dbid=self.FocusedItem(control_id).getVideoInfoTag().getDbId()):
             xbmc.sleep(2000)
             self.update(force_update=True)
             self.setCurrentListPosition(self.position)
     elif selection == 1:
         tmdb.change_fav_status(media_id=item_id,
                                media_type=self.type,
                                status="true")
     elif selection == 2:
         self.list_dialog(item_id)
     elif selection == 3:
         tmdb.change_list_status(list_id=self.list_id,
                                 movie_id=item_id,
                                 status=False)
         self.update(force_update=True)
         self.setCurrentListPosition(self.position)
Beispiel #2
0
 def list_dialog(self, movie_id):
     busy.show_busy()
     listitems = [addon.LANG(32139)]
     account_lists = tmdb.get_account_lists()
     listitems += [
         "%s (%i)" % (i["name"], i["item_count"]) for i in account_lists
     ]
     listitems.append(addon.LANG(32138))
     busy.hide_busy()
     index = xbmcgui.Dialog().select(heading=addon.LANG(32136),
                                     list=listitems)
     if index == 0:
         listname = xbmcgui.Dialog().input(heading=addon.LANG(32137),
                                           type=xbmcgui.INPUT_ALPHANUM)
         if listname:
             xbmc.sleep(1000)
             tmdb.change_list_status(list_id=tmdb.create_list(listname),
                                     movie_id=movie_id,
                                     status=True)
     elif index == len(listitems) - 1:
         tmdb.remove_list_dialog(tmdb.handle_lists(account_lists))
     elif index > 0:
         tmdb.change_list_status(list_id=account_lists[index - 1]["id"],
                                 movie_id=movie_id,
                                 status=True)
 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))
     index = xbmcgui.Dialog().contextmenu(list=options)
     if index == 0:
         rating = utils.input_userrating()
         if rating == -1:
             return None
         tmdb.set_rating(media_type="movie",
                         media_id=movie_id,
                         rating=rating,
                         dbid=dbid)
         xbmc.sleep(2000)
         tmdb.get_movie(movie_id=movie_id,
                        cache_days=0)
     elif index == 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)
 def add_to_list_button(self, control_id):
     busy.show_busy()
     account_lists = tmdb.get_account_lists()
     listitems = [
         "%s (%i)" % (i["name"], i["item_count"]) for i in account_lists
     ]
     listitems.insert(0, addon.LANG(32139))
     listitems.append(addon.LANG(32138))
     busy.hide_busy()
     index = xbmcgui.Dialog().select(heading=addon.LANG(32136),
                                     list=listitems)
     if index == 0:
         listname = xbmcgui.Dialog().input(heading=addon.LANG(32137),
                                           type=xbmcgui.INPUT_ALPHANUM)
         if not listname:
             return None
         list_id = tmdb.create_list(listname)
         xbmc.sleep(1000)
         tmdb.change_list_status(list_id=list_id,
                                 movie_id=self.info.get_property("id"),
                                 status=True)
     elif index == len(listitems) - 1:
         if tmdb.remove_list_dialog(tmdb.handle_lists(account_lists)):
             self.update_states()
     elif index > 0:
         tmdb.change_list_status(account_lists[index - 1]["id"],
                                 self.info.get_property("id"), True)
         self.update_states()
 def add_to_list_button(self, control_id):
     busy.show_busy()
     account_lists = tmdb.get_account_lists()
     listitems = ["%s (%i)" % (i["name"], i["item_count"]) for i in account_lists]
     listitems.insert(0, addon.LANG(32139))
     listitems.append(addon.LANG(32138))
     busy.hide_busy()
     index = xbmcgui.Dialog().select(heading=addon.LANG(32136),
                                     list=listitems)
     if index == 0:
         listname = xbmcgui.Dialog().input(heading=addon.LANG(32137),
                                           type=xbmcgui.INPUT_ALPHANUM)
         if not listname:
             return None
         list_id = tmdb.create_list(listname)
         xbmc.sleep(1000)
         tmdb.change_list_status(list_id=list_id,
                                 movie_id=self.info.get_property("id"),
                                 status=True)
     elif index == len(listitems) - 1:
         if tmdb.remove_list_dialog(tmdb.handle_lists(account_lists)):
             self.update_states()
     elif index > 0:
         tmdb.change_list_status(account_lists[index - 1]["id"], self.info.get_property("id"), True)
         self.update_states()
Beispiel #6
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))
     index = xbmcgui.Dialog().contextmenu(list=options)
     if index == 0:
         rating = utils.input_userrating()
         if rating == -1:
             return None
         tmdb.set_rating(media_type="movie",
                         media_id=movie_id,
                         rating=rating,
                         dbid=dbid)
         xbmc.sleep(2000)
         tmdb.get_movie(movie_id=movie_id, cache_days=0)
     elif index == 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)
Beispiel #7
0
 def context_menu(self, control_id):
     item_id = self.FocusedItem(control_id).getProperty("id")
     media_type = self.FocusedItem(
         control_id).getVideoInfoTag().getMediaType()
     listitems = [addon.LANG(32169)
                  ] if media_type == "tvshow" else [addon.LANG(32113)]
     if self.logged_in:
         listitems += [addon.LANG(14076)]
         if not self.type == "tv":
             listitems += [addon.LANG(32107)]
         if self.mode == "list":
             listitems += [addon.LANG(32035)]
     index = xbmcgui.Dialog().contextmenu(list=listitems)
     if index == 0:
         # HACK until we can get userrating from listitem via python
         rating = utils.get_infolabel("listitem.userrating")
         rating = utils.input_userrating(
             preselect=int(rating) if rating.isdigit() else -1)
         if rating == -1:
             return None
         if tmdb.set_rating(
                 media_type="tv" if media_type == "tvshow" else "movie",
                 media_id=item_id,
                 rating=rating,
                 dbid=self.FocusedItem(
                     control_id).getVideoInfoTag().getDbId()):
             xbmc.sleep(2000)
             self.update(force_update=True)
             self.setCurrentListPosition(self.position)
     elif index == 1:
         tmdb.change_fav_status(media_id=item_id,
                                media_type=self.type,
                                status="true")
     elif index == 2:
         self.list_dialog(item_id)
     elif index == 3:
         tmdb.change_list_status(list_id=self.list_id,
                                 movie_id=item_id,
                                 status=False)
         self.update(force_update=True)
         self.setCurrentListPosition(self.position)
 def list_dialog(self, movie_id):
     busy.show_busy()
     listitems = [addon.LANG(32139)]
     account_lists = tmdb.get_account_lists()
     listitems += ["%s (%i)" % (i["name"], i["item_count"]) for i in account_lists]
     listitems.append(addon.LANG(32138))
     busy.hide_busy()
     index = xbmcgui.Dialog().select(heading=addon.LANG(32136),
                                     list=listitems)
     if index == 0:
         listname = xbmcgui.Dialog().input(heading=addon.LANG(32137),
                                           type=xbmcgui.INPUT_ALPHANUM)
         if listname:
             xbmc.sleep(1000)
             tmdb.change_list_status(list_id=tmdb.create_list(listname),
                                     movie_id=movie_id,
                                     status=True)
     elif index == len(listitems) - 1:
         tmdb.remove_list_dialog(tmdb.handle_lists(account_lists))
     elif index > 0:
         tmdb.change_list_status(list_id=account_lists[index - 1]["id"],
                                 movie_id=movie_id,
                                 status=True)
 def context_menu(self, control_id):
     item_id = self.FocusedItem(control_id).getProperty("id")
     media_type = self.FocusedItem(control_id).getVideoInfoTag().getMediaType()
     listitems = [addon.LANG(32169)] if media_type == "tvshow" else [addon.LANG(32113)]
     if self.logged_in:
         listitems += [addon.LANG(14076)]
         if not self.type == "tv":
             listitems += [addon.LANG(32107)]
         if self.mode == "list":
             listitems += [addon.LANG(32035)]
     index = xbmcgui.Dialog().contextmenu(list=listitems)
     if index == 0:
         # HACK until we can get userrating from listitem via python
         rating = utils.get_infolabel("listitem.userrating")
         rating = utils.input_userrating(preselect=int(rating) if rating.isdigit() else -1)
         if rating == -1:
             return None
         if tmdb.set_rating(media_type="tv" if media_type == "tvshow" else "movie",
                            media_id=item_id,
                            rating=rating,
                            dbid=self.FocusedItem(control_id).getVideoInfoTag().getDbId()):
             xbmc.sleep(2000)
             self.update(force_update=True)
             self.setCurrentListPosition(self.position)
     elif index == 1:
         tmdb.change_fav_status(media_id=item_id,
                                media_type=self.type,
                                status="true")
     elif index == 2:
         self.list_dialog(item_id)
     elif index == 3:
         tmdb.change_list_status(list_id=self.list_id,
                                 movie_id=item_id,
                                 status=False)
         self.update(force_update=True)
         self.setCurrentListPosition(self.position)
 def context_menu(self, control_id):
     item_id = self.FocusedItem(control_id).getProperty("id")
     media_type = self.FocusedItem(
         control_id).getVideoInfoTag().getMediaType()
     listitems = [addon.LANG(32169)
                  ] if media_type == "tvshow" else [addon.LANG(32113)]
     if self.logged_in:
         listitems += [addon.LANG(14076)]
         if not self.type == "tv":
             listitems += [addon.LANG(32107)]
         if self.mode == "list":
             listitems += [addon.LANG(32035)]
     selection = xbmcgui.Dialog().contextmenu(list=listitems)
     if selection == 0:
         rating = utils.input_userrating()
         if tmdb.set_rating(
                 media_type="tv" if media_type == "tvshow" else "movie",
                 media_id=item_id,
                 rating=rating,
                 dbid=self.FocusedItem(
                     control_id).getVideoInfoTag().getDbId()):
             xbmc.sleep(2000)
             self.update(force_update=True)
             self.setCurrentListPosition(self.position)
     elif selection == 1:
         tmdb.change_fav_status(media_id=item_id,
                                media_type=self.type,
                                status="true")
     elif selection == 2:
         self.list_dialog(item_id)
     elif selection == 3:
         tmdb.change_list_status(list_id=self.list_id,
                                 movie_id=item_id,
                                 status=False)
         self.update(force_update=True)
         self.setCurrentListPosition(self.position)