Esempio n. 1
0
    def updateShow(self, show, force=False):

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

        if self.isBeingUpdated(show):
            raise CantUpdateShowException(
                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 CantUpdateShowException(
                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
Esempio n. 2
0
    def update_show(self, show, force=False):

        if self.is_being_added(show):
            raise CantUpdateShowException(
                '{0} is still being added, wait until it is finished before you update.'
                .format(show.name))

        if self.is_being_updated(show):
            raise CantUpdateShowException(
                '{0} is already being updated by Post-processor or manually started, can\'t update again until it\'s done.'
                .format(show.name))

        if self.is_in_update_queue(show):
            raise CantUpdateShowException(
                '{0} is in process of being updated by Post-processor or manually started, can\'t update again until it\'s done.'
                .format(show.name))

        queue_item_obj = QueueItemUpdate(show, force=force)
        self.add_item(queue_item_obj)
        return queue_item_obj