コード例 #1
0
ファイル: search.py プロジェクト: TATUMTOT/SickRage
 def __init__(self, show, segment):
     QueueItem.__init__(self, 'Backlog', BACKLOG_SEARCH)
     self.priority = QueuePriorities.LOW
     self.name = 'BACKLOG-' + str(show.indexerid)
     self.success = None
     self.show = show
     self.segment = segment
コード例 #2
0
ファイル: search.py プロジェクト: TATUMTOT/SickRage
    def run(self):
        QueueItem.run(self)

        try:
            sickrage.LOGGER.info("Beginning daily search for new episodes")
            foundResults = searchForNeededEpisodes()

            if not len(foundResults):
                sickrage.LOGGER.info("No needed episodes found")
            else:
                for result in foundResults:
                    # just use the first result for now
                    sickrage.LOGGER.info("Downloading " + result.name + " from " + result.provider.name)
                    self.success = snatchEpisode(result)

                    # give the CPU a break
                    gen.sleep(cpu_presets[sickrage.CPU_PRESET])

            QueueItem.finish(self)
        except Exception:
            sickrage.LOGGER.debug(traceback.format_exc())

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

        self.finish()
コード例 #3
0
ファイル: search.py プロジェクト: TATUMTOT/SickRage
    def run(self):
        QueueItem.run(self)

        try:
            sickrage.LOGGER.info("Beginning manual search for: [" + self.segment.prettyName() + "]")
            self.started = True

            searchResult = searchProviders(self.show, [self.segment], True, self.downCurQuality)

            if searchResult:
                # just use the first result for now
                sickrage.LOGGER.info("Downloading " + searchResult[0].name + " from " + searchResult[0].provider.name)
                self.success = snatchEpisode(searchResult[0])

                # give the CPU a break
                gen.sleep(cpu_presets[sickrage.CPU_PRESET])

            else:
                notifications.message('No downloads were found',
                                      "Couldn't find a download for <i>%s</i>" % self.segment.prettyName())

                sickrage.LOGGER.info("Unable to find a download for: [" + self.segment.prettyName() + "]")

        except Exception:
            sickrage.LOGGER.debug(traceback.format_exc())

        ### Keep a list with the 100 last executed searches
        fifo(MANUAL_SEARCH_HISTORY, self, MANUAL_SEARCH_HISTORY_SIZE)

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

        self.finish()
コード例 #4
0
ファイル: search.py プロジェクト: TATUMTOT/SickRage
 def __init__(self, show, segment, downCurQuality=False):
     QueueItem.__init__(self, 'Retry', FAILED_SEARCH)
     self.priority = QueuePriorities.HIGH
     self.name = 'RETRY-' + str(show.indexerid)
     self.show = show
     self.segment = segment
     self.success = None
     self.started = None
     self.downCurQuality = downCurQuality
コード例 #5
0
ファイル: search.py プロジェクト: TATUMTOT/SickRage
 def __init__(self, show, segment, downCurQuality=False):
     QueueItem.__init__(self, 'Manual Search', MANUAL_SEARCH)
     self.priority = QueuePriorities.HIGH
     self.name = 'MANUAL-' + str(show.indexerid)
     self.success = None
     self.show = show
     self.segment = segment
     self.started = None
     self.downCurQuality = downCurQuality
コード例 #6
0
    def run(self):
        QueueItem.run(self)
        self.started = True

        try:
            for epObj in self.segment:

                sickrage.LOGGER.info("Marking episode as bad: [" +
                                     epObj.prettyName() + "]")

                FailedHistory.markFailed(epObj)

                (release, provider) = FailedHistory.findFailedRelease(epObj)
                if release:
                    FailedHistory.logFailed(release)
                    History.logFailed(epObj, release, provider)

                FailedHistory.revertFailedEpisode(epObj)
                sickrage.LOGGER.info(
                    "Beginning failed download search for: [" +
                    epObj.prettyName() + "]")

            # If it is wanted, self.downCurQuality doesnt matter
            # if it isnt wanted, we need to make sure to not overwrite the existing ep that we reverted to!
            searchResult = searchProviders(self.show, self.segment, True,
                                           False)

            if searchResult:
                for result in searchResult:
                    # just use the first result for now
                    sickrage.LOGGER.info("Downloading " + result.name +
                                         " from " + result.provider.name)
                    snatchEpisode(result)

                    # give the CPU a break
                    gen.sleep(cpu_presets[sickrage.CPU_PRESET])
            else:
                pass
                # sickrage.LOGGER.info(u"No valid episode found to retry for: [" + self.segment.prettyName() + "]")
        except Exception:
            sickrage.LOGGER.debug(traceback.format_exc())

        ### Keep a list with the 100 last executed searches
        fifo(MANUAL_SEARCH_HISTORY, self, MANUAL_SEARCH_HISTORY_SIZE)

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

        self.finish()
コード例 #7
0
ファイル: search.py プロジェクト: TATUMTOT/SickRage
    def run(self):
        QueueItem.run(self)
        self.started = True

        try:
            for epObj in self.segment:

                sickrage.LOGGER.info("Marking episode as bad: [" + epObj.prettyName() + "]")

                FailedHistory.markFailed(epObj)

                (release, provider) = FailedHistory.findFailedRelease(epObj)
                if release:
                    FailedHistory.logFailed(release)
                    History.logFailed(epObj, release, provider)

                FailedHistory.revertFailedEpisode(epObj)
                sickrage.LOGGER.info("Beginning failed download search for: [" + epObj.prettyName() + "]")

            # If it is wanted, self.downCurQuality doesnt matter
            # if it isnt wanted, we need to make sure to not overwrite the existing ep that we reverted to!
            searchResult = searchProviders(self.show, self.segment, True, False)

            if searchResult:
                for result in searchResult:
                    # just use the first result for now
                    sickrage.LOGGER.info("Downloading " + result.name + " from " + result.provider.name)
                    snatchEpisode(result)

                    # give the CPU a break
                    gen.sleep(cpu_presets[sickrage.CPU_PRESET])
            else:
                pass
                # sickrage.LOGGER.info(u"No valid episode found to retry for: [" + self.segment.prettyName() + "]")
        except Exception:
            sickrage.LOGGER.debug(traceback.format_exc())

        ### Keep a list with the 100 last executed searches
        fifo(MANUAL_SEARCH_HISTORY, self, MANUAL_SEARCH_HISTORY_SIZE)

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

        self.finish()
コード例 #8
0
ファイル: search.py プロジェクト: TATUMTOT/SickRage
    def run(self):
        QueueItem.run(self)

        if not self.show.paused:
            try:
                sickrage.LOGGER.info("Beginning backlog search for: [" + self.show.name + "]")
                searchResult = searchProviders(self.show, self.segment, False)

                if searchResult:
                    for result in searchResult:
                        # just use the first result for now
                        sickrage.LOGGER.info("Downloading " + result.name + " from " + result.provider.name)
                        snatchEpisode(result)

                        # give the CPU a break
                        gen.sleep(cpu_presets[sickrage.CPU_PRESET])
                else:
                    sickrage.LOGGER.info("No needed episodes found during backlog search for: [" + self.show.name + "]")
            except Exception:
                sickrage.LOGGER.debug(traceback.format_exc())

        self.finish()
コード例 #9
0
    def run(self):
        QueueItem.run(self)

        try:
            sickrage.LOGGER.info("Beginning manual search for: [" +
                                 self.segment.prettyName() + "]")
            self.started = True

            searchResult = searchProviders(self.show, [self.segment], True,
                                           self.downCurQuality)

            if searchResult:
                # just use the first result for now
                sickrage.LOGGER.info("Downloading " + searchResult[0].name +
                                     " from " + searchResult[0].provider.name)
                self.success = snatchEpisode(searchResult[0])

                # give the CPU a break
                gen.sleep(cpu_presets[sickrage.CPU_PRESET])

            else:
                notifications.message(
                    'No downloads were found',
                    "Couldn't find a download for <i>%s</i>" %
                    self.segment.prettyName())

                sickrage.LOGGER.info("Unable to find a download for: [" +
                                     self.segment.prettyName() + "]")

        except Exception:
            sickrage.LOGGER.debug(traceback.format_exc())

        ### Keep a list with the 100 last executed searches
        fifo(MANUAL_SEARCH_HISTORY, self, MANUAL_SEARCH_HISTORY_SIZE)

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

        self.finish()
コード例 #10
0
ファイル: search.py プロジェクト: TATUMTOT/SickRage
 def __init__(self):
     self.success = None
     QueueItem.__init__(self, 'Daily Search', DAILY_SEARCH)
コード例 #11
0
 def __init__(self):
     self.success = None
     QueueItem.__init__(self, 'Daily Search', DAILY_SEARCH)