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


Python NameParser.qualitiy方法代码示例

本文整理汇总了Python中sickbeard.name_parser.parser.NameParser.qualitiy方法的典型用法代码示例。如果您正苦于以下问题:Python NameParser.qualitiy方法的具体用法?Python NameParser.qualitiy怎么用?Python NameParser.qualitiy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sickbeard.name_parser.parser.NameParser的用法示例。


在下文中一共展示了NameParser.qualitiy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _addCacheEntry

# 需要导入模块: from sickbeard.name_parser.parser import NameParser [as 别名]
# 或者: from sickbeard.name_parser.parser.NameParser import qualitiy [as 别名]
    def _addCacheEntry(self, name, url, parse_result=None, indexer_id=0):

        # check if we passed in a parsed result or should we try and create one
        if not parse_result:

            # create showObj from indexer_id if available
            showObj = None
            if indexer_id:
                showObj = Show.find(sickbeard.showList, indexer_id)

            try:

                parse_result = NameParser(showObj=showObj).parse(name)
                parse_result.qualitiy = provider.get_quality(item)
            except (InvalidNameException, InvalidShowException) as error:
                logger.log(u"{0}".format(error), logger.DEBUG)
                return None

            if not parse_result or not parse_result.series_name:
                return None

        # if we made it this far then lets add the parsed result to cache for usager later on
        season = parse_result.season_number if parse_result.season_number else 1
        episodes = parse_result.episode_numbers

        if season and episodes:
            # store episodes as a seperated string
            episodeText = "|" + "|".join({str(episode) for episode in episodes if episode}) + "|"

            # get the current timestamp
            curTimestamp = int(time.mktime(datetime.datetime.today().timetuple()))

            # get quality of release
            quality = parse_result.quality

            assert isinstance(name, unicode)

            # get release group
            release_group = parse_result.release_group

            # get version
            version = parse_result.version

            logger.log(u"Added RSS item: [" + name + "] to cache: [" + self.providerID + "]", logger.DEBUG)

            return [
                "INSERT OR IGNORE INTO [" + self.providerID + "] (name, season, episodes, indexerid, url, time, quality, release_group, version) VALUES (?,?,?,?,?,?,?,?,?)",
                [name, season, episodeText, parse_result.show.indexerid, url, curTimestamp, quality, release_group, version]]
开发者ID:Maximilian-Reuter,项目名称:SickRage-1,代码行数:50,代码来源:tvcache.py


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