コード例 #1
0
ファイル: show_queue.py プロジェクト: operthuis/SickRage
    def updateShow(self, show, force=False):

        if self.isBeingAdded(show):
            raise exceptions.CantUpdateException(
                str(show.name) +
                u" is still being added, wait until it is finished before you update."
            )

        if self.isBeingUpdated(show):
            raise exceptions.CantUpdateException(
                str(show.name) +
                u" is already being updated by Post-processor or manually started, can't update again until it's done."
            )

        if self.isInUpdateQueue(show):
            raise exceptions.CantUpdateException(
                str(show.name) +
                u" is in process of being updated by Post-processor or manually started, can't update again until it's done."
            )

        if not force:
            queueItemObj = QueueItemUpdate(show)
        else:
            queueItemObj = QueueItemForceUpdate(show)

        self.add_item(queueItemObj)

        return queueItemObj
コード例 #2
0
    def updateShow(self, show, force=False):

        if self.isBeingAdded(show):
            raise exceptions.CantUpdateException(
                "Show is still being added, wait until it is finished before you update."
            )

        if self.isBeingUpdated(show):
            raise exceptions.CantUpdateException(
                "This show is already being updated, can't update again until it's done."
            )

        if self.isInUpdateQueue(show):
            raise exceptions.CantUpdateException(
                "This show is already being updated, can't update again until it's done."
            )

        if not force:
            queueItemObj = QueueItemUpdate(show)
        else:
            queueItemObj = QueueItemForceUpdate(show)

        self.add_item(queueItemObj)

        return queueItemObj
コード例 #3
0
    def updateShow(self, show, force=False, web=False, scheduled_update=False):

        if self.isBeingAdded(show):
            raise exceptions.CantUpdateException(
                'Show is still being added, wait until it is finished before you update.'
            )

        if self.isBeingUpdated(show):
            raise exceptions.CantUpdateException(
                'This show is already being updated, can\'t update again until it\'s done.'
            )

        if self.isInUpdateQueue(show):
            raise exceptions.CantUpdateException(
                'This show is already being updated, can\'t update again until it\'s done.'
            )

        if not force:
            queueItemObj = QueueItemUpdate(show,
                                           scheduled_update=scheduled_update)
        elif web:
            queueItemObj = QueueItemForceUpdateWeb(
                show, scheduled_update=scheduled_update)
        else:
            queueItemObj = QueueItemForceUpdate(
                show, scheduled_update=scheduled_update)

        self.add_item(queueItemObj)

        return queueItemObj