本文整理汇总了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