Ejemplo n.º 1
0
    def update_show(self, indexer_id, indexer_update_only=False, force=False):
        show_obj = find_show(indexer_id)

        if self.is_being_added(indexer_id):
            raise CantUpdateShowException(
                "{} is still being added, please wait until it is finished before trying to update."
                .format(show_obj.name))

        if self.is_being_updated(indexer_id):
            raise CantUpdateShowException(
                "{} is already being updated, can't update again until it's done."
                .format(show_obj.name))

        if self.is_being_updated(indexer_id):
            raise CantUpdateShowException(
                "{} is in the process of being updated, can't update again until it's done."
                .format(show_obj.name))

        if force:
            sickrage.app.io_loop.add_callback(
                self.put, QueueItemForceUpdate(indexer_id,
                                               indexer_update_only))
        else:
            sickrage.app.io_loop.add_callback(
                self.put, QueueItemUpdate(indexer_id, indexer_update_only))
Ejemplo n.º 2
0
    def updateShow(self, show, force=False):

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

        if self.isBeingUpdated(show):
            raise CantUpdateShowException(
                str(show.name) +
                " 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) +
                " 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
Ejemplo n.º 3
0
    def updateShow(self, show, force=False):
        if self.isBeingAdded(show):
            raise CantUpdateShowException("{} is still being added, please wait until it is finished before trying to "
                                          "update.".format(show.name))

        if self.isBeingUpdated(show):
            raise CantUpdateShowException("{} is already being updated, can't update again until "
                                          "it's done.".format(show.name))

        if self.isInUpdateQueue(show):
            raise CantUpdateShowException("{} is in the process of being updated, can't update again until "
                                          "it's done.".format(show.name))

        return self.put(QueueItemForceUpdate(show)) if force else self.put(QueueItemUpdate(show))
Ejemplo n.º 4
0
    def update_show(self, series_id, series_provider_id, force=False):
        show_obj = find_show(series_id, series_provider_id)

        if self.is_being_added(series_id):
            raise CantUpdateShowException(
                "{} is still being added, please wait until it is finished before trying to update."
                .format(show_obj.name))

        if self.is_being_updated(series_id):
            raise CantUpdateShowException(
                "{} is already being updated, can't update again until it's done."
                .format(show_obj.name))

        task_id = self.put(ShowTaskUpdate(series_id, series_provider_id,
                                          force))

        self.put(ShowTaskRefresh(series_id, series_provider_id, force=force),
                 depend=[task_id])
Ejemplo n.º 5
0
    def update_show(self, indexer_id, indexer_update_only=False, force=False):
        show_obj = find_show(indexer_id)

        if self.is_being_added(indexer_id):
            raise CantUpdateShowException(
                "{} is still being added, please wait until it is finished before trying to update."
                .format(show_obj.name))

        if self.is_being_updated(indexer_id):
            raise CantUpdateShowException(
                "{} is already being updated, can't update again until it's done."
                .format(show_obj.name))

        if force:
            task_id = self.put(
                ShowTaskForceUpdate(indexer_id, indexer_update_only))
        else:
            task_id = self.put(ShowTaskUpdate(indexer_id, indexer_update_only))

        if not indexer_update_only:
            self.put(ShowTaskRefresh(indexer_id, force=force),
                     depend=[task_id])