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


Python TheMovieDB.change_fav_status方法代碼示例

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


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

示例1: change_list_status

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import change_fav_status [as 別名]
 def change_list_status(self, control_id):
     tmdb.change_fav_status(
         media_id=self.info.get_property("id"),
         media_type=self.TYPE_ALT,
         status=str(not bool(self.states["favorite"])).lower(),
     )
     self.update_states()
開發者ID:phil65,項目名稱:script.extendedinfo,代碼行數:9,代碼來源:DialogVideoInfo.py

示例2: context_menu

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import change_fav_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

示例3: context_menu

# 需要導入模塊: from resources.lib import TheMovieDB [as 別名]
# 或者: from resources.lib.TheMovieDB import change_fav_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_fav_status方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。