本文整理汇总了Python中sickbeard.common.Quality.to_guessit方法的典型用法代码示例。如果您正苦于以下问题:Python Quality.to_guessit方法的具体用法?Python Quality.to_guessit怎么用?Python Quality.to_guessit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sickbeard.common.Quality
的用法示例。
在下文中一共展示了Quality.to_guessit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: refine
# 需要导入模块: from sickbeard.common import Quality [as 别名]
# 或者: from sickbeard.common.Quality import to_guessit [as 别名]
def refine(video, tv_episode=None, **kwargs):
"""Refine a video by using TVEpisode information.
:param video: the video to refine.
:type video: Episode
:param tv_episode: the TVEpisode to be used.
:type tv_episode: sickbeard.tv.TVEpisode
:param kwargs:
"""
if video.series_tvdb_id and video.tvdb_id:
logger.debug('No need to refine with TVEpisode')
return
if not tv_episode:
logger.debug('No TVEpisode to be used to refine')
return
if not isinstance(video, Episode):
logger.debug('Video {name} is not an episode. Skipping refiner...', name=video.name)
return
if tv_episode.show:
logger.debug('Refining using TVShow information.')
series, year, country = series_re.match(tv_episode.show.name).groups()
enrich({'series': series, 'year': int(year) if year else None}, video)
enrich(SHOW_MAPPING, video, tv_episode.show)
logger.debug('Refining using TVEpisode information.')
enrich(EPISODE_MAPPING, video, tv_episode)
enrich({'release_group': tv_episode.release_group}, video, overwrite=False)
guess = Quality.to_guessit(tv_episode.status)
enrich({'resolution': guess['screen_size'], 'format': guess['format']}, video, overwrite=False)