本文整理汇总了Python中sickbeard.tv.TVShow.loadFromTVDB方法的典型用法代码示例。如果您正苦于以下问题:Python TVShow.loadFromTVDB方法的具体用法?Python TVShow.loadFromTVDB怎么用?Python TVShow.loadFromTVDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sickbeard.tv.TVShow
的用法示例。
在下文中一共展示了TVShow.loadFromTVDB方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from sickbeard.tv import TVShow [as 别名]
# 或者: from sickbeard.tv.TVShow import loadFromTVDB [as 别名]
def execute(self):
ShowQueueItem.execute(self)
logger.log(u"Starting to add show "+self.showDir)
try:
newShow = TVShow(self.tvdb_id, self.lang)
newShow.loadFromTVDB()
self.show = newShow
# set up initial values
self.show.location = self.showDir
self.show.quality = sickbeard.QUALITY_DEFAULT
self.show.seasonfolders = sickbeard.SEASON_FOLDERS_DEFAULT
self.show.paused = False
except tvdb_exceptions.tvdb_exception, e:
logger.log(u"Unable to add show due to an error with TVDB: "+str(e).decode('utf-8'), logger.ERROR)
if self.show:
ui.flash.error("Unable to add "+str(self.show.name)+" due to an error with TVDB")
else:
ui.flash.error("Unable to add show due to an error with TVDB")
self._finishEarly()
return
示例2: execute
# 需要导入模块: from sickbeard.tv import TVShow [as 别名]
# 或者: from sickbeard.tv.TVShow import loadFromTVDB [as 别名]
def execute(self):
ShowQueueItem.execute(self)
logger.log(u"Starting to add show "+self.showDir)
try:
# make sure the tvdb ids are valid
try:
ltvdb_api_parms = sickbeard.TVDB_API_PARMS.copy()
if self.lang:
ltvdb_api_parms['language'] = self.lang
t = tvdb_api.Tvdb(**ltvdb_api_parms)
s = t[self.tvdb_id]
if not s or not s['seriesname']:
ui.flash.error("Unable to add show", "Show in "+str(self.showDir)+" has no name on TVDB, probably the wrong language. Delete .nfo and add manually in the correct language.")
self._finishEarly()
return
except tvdb_exceptions.tvdb_exception, e:
ui.flash.error("Unable to add show", "Unable to look up the show in "+str(self.showDir)+" on TVDB, not using the NFO. Delete .nfo and add manually in the correct language.")
self._finishEarly()
return
newShow = TVShow(self.tvdb_id, self.lang)
newShow.loadFromTVDB()
self.show = newShow
# set up initial values
self.show.location = self.showDir
self.show.quality = self.quality if self.quality else sickbeard.QUALITY_DEFAULT
self.show.seasonfolders = self.season_folders if self.season_folders != None else sickbeard.SEASON_FOLDERS_DEFAULT
self.show.paused = False
示例3: execute
# 需要导入模块: from sickbeard.tv import TVShow [as 别名]
# 或者: from sickbeard.tv.TVShow import loadFromTVDB [as 别名]
def execute(self):
ShowQueueItem.execute(self)
logger.log(u"Starting to add show " + self.showDir)
try:
# make sure the tvdb ids are valid
try:
ltvdb_api_parms = sickbeard.TVDB_API_PARMS.copy()
if self.lang:
ltvdb_api_parms["language"] = self.lang
logger.log(u"TVDB: " + repr(ltvdb_api_parms))
t = tvdb_api.Tvdb(**ltvdb_api_parms)
s = t[self.tvdb_id]
# this usually only happens if they have an NFO in their show dir which gave us a TVDB ID that has no
# proper english version of the show
if not s or not s["seriesname"]:
ui.notifications.error(
"Unable to add show",
"Show in "
+ self.showDir
+ " has no name on TVDB, probably the wrong language. Delete .nfo and add manually in the correct language.",
)
self._finishEarly()
return
except tvdb_exceptions.tvdb_exception, e:
logger.log(u"Error contacting TVDB: " + ex(e), logger.ERROR)
ui.notifications.error(
"Unable to add show",
"Unable to look up the show in "
+ self.showDir
+ " on TVDB, not using the NFO. Delete .nfo and add manually in the correct language.",
)
self._finishEarly()
return
# clear the name cache
name_cache.clearCache()
newShow = TVShow(self.tvdb_id, self.lang)
newShow.loadFromTVDB()
self.show = newShow
# set up initial values
self.show.location = self.showDir
self.show.quality = self.quality if self.quality else sickbeard.QUALITY_DEFAULT
self.show.flatten_folders = (
self.flatten_folders if self.flatten_folders != None else sickbeard.FLATTEN_FOLDERS_DEFAULT
)
self.show.paused = False
# be smartish about this
if self.show.genre and "talk show" in self.show.genre.lower():
self.show.air_by_date = 1
示例4: QueueItemAdd
# 需要导入模块: from sickbeard.tv import TVShow [as 别名]
# 或者: from sickbeard.tv.TVShow import loadFromTVDB [as 别名]
class QueueItemAdd(QueueItem):
def __init__(self, show=None):
self.showDir = show
# if we can't create the dir, bail
if not os.path.isdir(self.showDir):
if not helpers.makeDir(self.showDir):
raise exceptions.NoNFOException("Unable to create the show dir " + self.showDir)
if not os.path.isfile(os.path.join(self.showDir, "tvshow.nfo")):
raise exceptions.NoNFOException("No tvshow.nfo found")
# this will initialize self.show to None
QueueItem.__init__(self, QueueActions.ADD)
self.initialShow = TVShow(self.showDir)
def _getName(self):
if self.show == None:
return self.showDir
return self.show.name
name = property(_getName)
def _isLoading(self):
if self.show == None:
return True
return False
isLoading = property(_isLoading)
def execute(self):
QueueItem.execute(self)
logger.log("Starting to add show "+self.showDir)
otherShow = helpers.findCertainShow(sickbeard.showList, self.initialShow.tvdbid)
if otherShow != None:
logger.log("Show is already in your list, not adding it again")
self.finish()
return
try:
self.initialShow.getImages()
self.initialShow.loadFromTVDB()
except tvdb_exceptions.tvdb_exception, e:
logger.log("Unable to add show due to an error with TVDB: "+str(e), logger.ERROR)
webserve.flash.error("Unable to add "+str(self.initialShow.name)+" due to an error with TVDB")
self._finishEarly()
return
except exceptions.NoNFOException:
logger.log("Unable to load show from NFO", logger.ERROR)
webserve.flash.error("Unable to add "+str(self.initialShow.name)+" from NFO, skipping")
self._finishEarly()
return
示例5: QueueItemAdd
# 需要导入模块: from sickbeard.tv import TVShow [as 别名]
# 或者: from sickbeard.tv.TVShow import loadFromTVDB [as 别名]
class QueueItemAdd(QueueItem):
def __init__(self, show=None):
self.showDir = show
# if we can't create the dir, bail
if not os.path.isdir(self.showDir):
if not helpers.makeDir(self.showDir):
raise exceptions.NoNFOException("Unable to create the show dir " + self.showDir)
if not os.path.isfile(os.path.join(self.showDir, "tvshow.nfo")):
raise exceptions.NoNFOException("No tvshow.nfo found")
# this will initialize self.show to None
QueueItem.__init__(self, QueueActions.ADD)
self.initialShow = TVShow(self.showDir)
def _getName(self):
if self.show == None:
return self.showDir
return self.show.name
name = property(_getName)
def _isLoading(self):
if self.show == None:
return True
return False
isLoading = property(_isLoading)
def execute(self):
QueueItem.execute(self)
logger.log("Starting to add show "+self.showDir)
try:
self.initialShow.getImages()
self.initialShow.loadFromTVDB()
except tvdb_exceptions.tvdb_exception, e:
logger.log("Unable to add show due to an error with TVDB: "+str(e), logger.ERROR)
self.finish()
return
except exceptions.NoNFOException:
logger.log("Unable to load show from NFO", logger.ERROR)
# take the show out of the loading list
self.finish()
return