Exemple #1
0
    def removeShow(self, show, full=False):
        if not show:
            raise CantRemoveShowException('Failed removing show: Show does not exist')
        elif not hasattr(show, 'indexerid'):
            raise CantRemoveShowException('Failed removing show: Show does not have an indexer id')
        elif self._isInQueue(show, (ShowQueueActions.REMOVE,)):
            raise CantRemoveShowException("{} is already queued to be removed".format(show))

        # remove other queued actions for this show.
        for __, __, x in self.queue:
            if x and x.show and x != self.currentItem and show.indexerid == x.show.indexerid:
                self.queue.remove(x)

        return self.put(QueueItemRemove(show=show, full=full))
Exemple #2
0
    def remove_show(self, indexer_id, full=False):
        show_obj = find_show(indexer_id)

        if not show_obj:
            raise CantRemoveShowException(
                'Failed removing show: Show does not exist')
        elif not hasattr(show_obj, 'indexer_id'):
            raise CantRemoveShowException(
                'Failed removing show: Show does not have an indexer id')
        elif self._is_being(show_obj.indexer_id, (ShowTaskActions.REMOVE, )):
            raise CantRemoveShowException(
                "{} is already queued to be removed".format(show_obj))

        # remove other queued actions for this show.
        self.remove_task(indexer_id)

        self.put(ShowTaskForceRemove(indexer_id=indexer_id, full=full))
Exemple #3
0
    def remove_show(self, indexer_id, full=False):
        show_obj = find_show(indexer_id)

        if not show_obj:
            raise CantRemoveShowException(
                'Failed removing show: Show does not exist')
        elif not hasattr(show_obj, 'indexer_id'):
            raise CantRemoveShowException(
                'Failed removing show: Show does not have an indexer id')
        elif self._is_being(show_obj.indexer_id, (ShowQueueActions.REMOVE, )):
            raise CantRemoveShowException(
                "{} is already queued to be removed".format(show_obj))

        # remove other queued actions for this show.
        [
            self.remove(x) for x in self.queue_items
            if indexer_id == x.indexer_id
        ]
        sickrage.app.io_loop.add_callback(
            self.put, QueueItemRemove(indexer_id=indexer_id, full=full))
Exemple #4
0
    def removeShow(self, show, full=False):
        if self._isInQueue(show, (ShowQueueActions.REMOVE,)):
            raise CantRemoveShowException("This show is already queued to be removed")
        elif show is None:
            raise CantRemoveShowException

        # remove other queued actions for this show.
        for _, _, x in self.queue:
            if show.indexerid == x.show.indexerid and x != self.currentItem:
                self.queue.remove(x)

        return self.put(QueueItemRemove(show=show, full=full))