当前位置: 首页>>代码示例>>Python>>正文


Python Quality.to_guessit方法代码示例

本文整理汇总了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)
开发者ID:Thraxis,项目名称:pymedusa,代码行数:34,代码来源:tvepisode.py


注:本文中的sickbeard.common.Quality.to_guessit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。