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


Python search.searchForNeededEpisodes函数代码示例

本文整理汇总了Python中sickbeard.search.searchForNeededEpisodes函数的典型用法代码示例。如果您正苦于以下问题:Python searchForNeededEpisodes函数的具体用法?Python searchForNeededEpisodes怎么用?Python searchForNeededEpisodes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: run

    def run(self):
        """
        Run daily search thread
        """
        generic_queue.QueueItem.run(self)
        self.started = True

        try:
            logger.log(u"Beginning daily search for new episodes")
            found_results = search.searchForNeededEpisodes()

            if not found_results:
                logger.log(u"No needed episodes found")
            else:
                for result in found_results:
                    # just use the first result for now
                    if result.seeders not in (-1, None) and result.leechers not in (-1, None):
                        logger.log(u"Downloading {0} with {1} seeders and {2} leechers from {3}".format(result.name,
                                   result.seeders, result.leechers, result.provider.name))
                    else:
                        logger.log(u"Downloading {0} from {1}".format(result.name, result.provider.name))
                    self.success = search.snatchEpisode(result)

                    # give the CPU a break
                    time.sleep(common.cpu_presets[sickbeard.CPU_PRESET])

        except Exception:
            self.success = False
            logger.log(traceback.format_exc(), logger.DEBUG)

        if self.success is None:
            self.success = False

        self.finish()
开发者ID:bitzorro,项目名称:SickRage,代码行数:34,代码来源:search_queue.py

示例2: searchForTodaysEpisodes

    def searchForTodaysEpisodes(self):

        self.amActive = True

        self._changeMissingEpisodes()

        # make sure our lists are up to date
        sickbeard.updateAiringList()
        sickbeard.updateComingList()

        with self.lock:
            
            logger.log("Beginning search for new episodes on RSS")

            foundResults = search.searchForNeededEpisodes()
            
            if not len(foundResults):
                logger.log("No needed episodes found on the RSS feeds")
            else:
                for curResult in foundResults:
                    search.snatchEpisode(curResult)
                    time.sleep(2)
                

        # update our lists to reflect any changes we just made
        sickbeard.updateAiringList()
        sickbeard.updateComingList()

        self.amActive = False
开发者ID:dny238,项目名称:Sick-Beard,代码行数:29,代码来源:searchCurrent.py

示例3: run

    def run(self):
        generic_queue.QueueItem.run(self)

        try:
            self._change_missing_episodes()

            self.update_providers()

            show_list = sickbeard.showList
            fromDate = datetime.date.fromordinal(1)
            for curShow in show_list:
                if curShow.paused:
                    continue

                self.episodes.extend(wantedEpisodes(curShow, fromDate))

            if not self.episodes:
                logger.log(u'No search of cache for episodes required')
                self.success = True
            else:
                num_shows = len(set([ep.show.name for ep in self.episodes]))
                logger.log(u'Found %d needed episode%s spanning %d show%s'
                           % (len(self.episodes), helpers.maybe_plural(len(self.episodes)),
                              num_shows, helpers.maybe_plural(num_shows)))

                try:
                    logger.log(u'Beginning recent search for episodes')
                    found_results = search.searchForNeededEpisodes(self.episodes)

                    if not len(found_results):
                        logger.log(u'No needed episodes found')
                    else:
                        for result in found_results:
                            # just use the first result for now
                            logger.log(u'Downloading %s from %s' % (result.name, result.provider.name))
                            self.success = search.snatchEpisode(result)

                            # give the CPU a break
                            time.sleep(common.cpu_presets[sickbeard.CPU_PRESET])

                except Exception:
                    logger.log(traceback.format_exc(), logger.DEBUG)

                if self.success is None:
                    self.success = False

        finally:
            self.finish()
开发者ID:joshguerette,项目名称:SickGear,代码行数:48,代码来源:search_queue.py

示例4: execute

    def execute(self):
        generic_queue.QueueItem.execute(self)

        self._changeMissingEpisodes()

        logger.log(u"Beginning search for new episodes on RSS")

        foundResults = search.searchForNeededEpisodes()

        if not len(foundResults):
            logger.log(u"No needed episodes found on the RSS feeds")
        else:
            for curResult in foundResults:
                search.snatchEpisode(curResult)
                time.sleep(2)

        generic_queue.QueueItem.finish(self)
开发者ID:BobWatson,项目名称:SickBeard-TVRage,代码行数:17,代码来源:search_queue.py

示例5: searchForTodaysEpisodes

    def searchForTodaysEpisodes(self):

        self.amActive = True

        backlogPaused = sickbeard.backlogSearchScheduler.action.amPaused
        if not backlogPaused:
            # pause the backlog to prevent race conditions downloading 2 episodes
            logger.log(u"Pausing backlog so it doesn't collide with episode search", logger.DEBUG)
            sickbeard.backlogSearchScheduler.action.amPaused = True
            while sickbeard.backlogSearchScheduler.action.am_running():
                logger.log(u"Backlog isn't waiting yet, trying again in 1s", logger.DEBUG)
                time.sleep(1)

        logger.log(u"Backlog is stopped, running search now", logger.DEBUG)

        self._changeMissingEpisodes()

        # make sure our lists are up to date
        sickbeard.updateAiringList()
        sickbeard.updateComingList()

        with self.lock:

            logger.log(u"Beginning search for new episodes on RSS")

            foundResults = search.searchForNeededEpisodes()

            if not len(foundResults):
                logger.log(u"No needed episodes found on the RSS feeds")
            else:
                for curResult in foundResults:
                    search.snatchEpisode(curResult)
                    time.sleep(2)


        # update our lists to reflect any changes we just made
        sickbeard.updateAiringList()
        sickbeard.updateComingList()

        if not backlogPaused:
            logger.log(u"Search is done, resuming backlog", logger.DEBUG)
            sickbeard.backlogSearchScheduler.action.amPaused = False
        else:
            logger.log(u"Search is done, leaving backlog paused", logger.DEBUG)

        self.amActive = False
开发者ID:DaveWhite,项目名称:Sick-Beard,代码行数:46,代码来源:searchCurrent.py

示例6: execute

    def execute(self):
        generic_queue.QueueItem.execute(self)

        logger.log("Beginning daily search for [" + self.show.name + "]")
        foundResults = search.searchForNeededEpisodes(self.show, self.segment)

        # reset thread back to original name
        threading.currentThread().name = self.thread_name

        if not len(foundResults):
            logger.log(u"No needed episodes found during daily search for [" + self.show.name + "]")
        else:
            for result in foundResults:
                # just use the first result for now
                logger.log(u"Downloading " + result.name + " from " + result.provider.name)
                search.snatchEpisode(result)

                # give the CPU a break
                time.sleep(common.cpu_presets[sickbeard.CPU_PRESET])

        generic_queue.QueueItem.finish(self)
开发者ID:Davejje,项目名称:SickRage,代码行数:21,代码来源:search_queue.py

示例7: execute

    def execute(self):
        generic_queue.QueueItem.execute(self)

        self._changeMissingEpisodes()

        logger.log(u"Beginning search for new episodes on RSS")

        foundResults = search.searchForNeededEpisodes()

        if not len(foundResults):
            logger.log(u"No needed episodes found on the RSS feeds")
        else:
            for curResult in foundResults:
                #FUGLY, but it works:
                try:
                    download_dir = curResult.episodes[0].show._location
                except:
                    download_dir = None

                search.snatchEpisode(curResult, download_dir=download_dir)
                time.sleep(2)

        generic_queue.QueueItem.finish(self)
开发者ID:ikkemaniac,项目名称:Sick-Beard,代码行数:23,代码来源:search_queue.py

示例8: process

    def process(self, curProvider):
        self._changeMissingEpisodes()

        logger.log(u"Beginning search for new episodes on RSS feeds and in cache")
        return search.searchForNeededEpisodes(curProvider)
开发者ID:3ne,项目名称:SickRage,代码行数:5,代码来源:search_queue.py


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