當前位置: 首頁>>代碼示例>>Python>>正文


Python TheMovieDB.change_list_status方法代碼示例

本文整理匯總了Python中resources.lib.TheMovieDB.change_list_status方法的典型用法代碼示例。如果您正苦於以下問題:Python TheMovieDB.change_list_status方法的具體用法?Python TheMovieDB.change_list_status怎麽用?Python TheMovieDB.change_list_status使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在resources.lib.TheMovieDB的用法示例。


在下文中一共展示了TheMovieDB.change_list_status方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: context_menu

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import change_list_status [as 別名]
 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)
開發者ID:OpenELEQ,項目名稱:script.extendedinfo,代碼行數:34,代碼來源:DialogVideoList.py

示例2: movie_context_menu

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import change_list_status [as 別名]
 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)
開發者ID:BigNoid,項目名稱:script.extendedinfo,代碼行數:30,代碼來源:DialogBaseInfo.py

示例3: add_to_list_button

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import change_list_status [as 別名]
 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()
開發者ID:phil65,項目名稱:script.extendedinfo,代碼行數:27,代碼來源:DialogMovieInfo.py

示例4: list_dialog

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import change_list_status [as 別名]
 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)
開發者ID:BigNoid,項目名稱:script.extendedinfo,代碼行數:25,代碼來源:DialogVideoList.py

示例5: context_menu

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import change_list_status [as 別名]
 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)
開發者ID:BigNoid,項目名稱:script.extendedinfo,代碼行數:38,代碼來源:DialogVideoList.py


注:本文中的resources.lib.TheMovieDB.change_list_status方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。