本文整理匯總了Python中sickrage.core.tv.show.TVShow.load_from_indexer方法的典型用法代碼示例。如果您正苦於以下問題:Python TVShow.load_from_indexer方法的具體用法?Python TVShow.load_from_indexer怎麽用?Python TVShow.load_from_indexer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sickrage.core.tv.show.TVShow
的用法示例。
在下文中一共展示了TVShow.load_from_indexer方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: QueueItemAdd
# 需要導入模塊: from sickrage.core.tv.show import TVShow [as 別名]
# 或者: from sickrage.core.tv.show.TVShow import load_from_indexer [as 別名]
#.........這裏部分代碼省略.........
IndexerApi(
self.indexer).name) + _(
" but contains no season/episode data."))
return self._finish_early()
except Exception as e:
sickrage.app.log.error(
"{}: Error while loading information from indexer {}. Error: {}".format(self.indexer_id, index_name, e))
sickrage.app.alerts.error(
_("Unable to add show"),
_("Unable to look up the show in {} on {} using ID {}, not using the NFO. Delete .nfo and try adding "
"manually again.").format(self.showDir, index_name, self.indexer_id)
)
if sickrage.app.config.use_trakt:
title = self.showDir.split("/")[-1]
data = {
'shows': [
{
'title': title,
'ids': {IndexerApi(self.indexer).trakt_id: self.indexer_id}
}
]
}
srTraktAPI()["sync/watchlist"].remove(data)
return self._finish_early()
try:
self.show = TVShow(self.indexer, self.indexer_id, self.lang)
self.show.load_from_indexer()
# set up initial values
self.show.location = self.showDir
self.show.subtitles = self.subtitles or sickrage.app.config.subtitles_default
self.show.subtitles_sr_metadata = self.subtitles_sr_metadata
self.show.quality = self.quality or sickrage.app.config.quality_default
self.show.flatten_folders = self.flatten_folders or sickrage.app.config.flatten_folders_default
self.show.anime = self.anime or sickrage.app.config.anime_default
self.show.scene = self.scene or sickrage.app.config.scene_default
self.show.skip_downloaded = self.skip_downloaded or sickrage.app.config.skip_downloaded_default
self.show.paused = self.paused or False
# set up default new/missing episode status
sickrage.app.log.info(
"Setting all current episodes to the specified default status: " + str(self.default_status))
self.show.default_ep_status = self.default_status
if self.show.anime:
self.show.release_groups = BlackAndWhiteList(self.show.indexerid)
if self.blacklist:
self.show.release_groups.set_black_keywords(self.blacklist)
if self.whitelist:
self.show.release_groups.set_white_keywords(self.whitelist)
# # be smartish about this
# if self.show.genre and "talk show" in self.show.genre.lower():
# self.show.air_by_date = 1
# if self.show.genre and "documentary" in self.show.genre.lower():
# self.show.air_by_date = 0
# if self.show.classification and "sports" in self.show.classification.lower():
# self.show.sports = 1