def removeShow(self, show, full=False): if show is None: raise CantRemoveShowException( u'Failed removing show: Show does not exist') if not hasattr(show, u'indexerid'): raise CantRemoveShowException( u'Failed removing show: Show does not have an indexer id') if self._isInQueue(show, (ShowQueueActions.REMOVE, )): raise CantRemoveShowException( u'[{!s}]: Show is already queued to be removed'.format( show.indexerid)) # remove other queued actions for this show. for item in self.queue: if all([ item, item.show, item != self.currentItem, show.indexerid == item.show.indexerid ]): self.queue.remove(item) queue_item_obj = QueueItemRemove(show=show, full=full) self.add_item(queue_item_obj) return queue_item_obj
def removeShow(self, show, full=False): if not show: raise CantRemoveShowException('Failed removing show: Show does not exist') if not hasattr(show, 'indexerid'): raise CantRemoveShowException('Failed removing show: Show does not have an indexer id') if self._isInQueue(show, (ShowQueueActions.REMOVE,)): raise CantRemoveShowException('{0} is already queued to be removed'.format(show.name)) # remove other queued actions for this show. for item in self.queue: if item and item.show and item != self.currentItem and show.indexerid == item.show.indexerid: self.queue.remove(item) queue_item_obj = QueueItemRemove(show=show, full=full) self.add_item(queue_item_obj) return queue_item_obj
def removeShow(self, show, full=False): if self._isInQueue(show, (ShowQueueActions.REMOVE,)): raise CantRemoveShowException("This show is already queued to be removed") # 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) queueItemObj = QueueItemRemove(show=show, full=full) self.add_item(queueItemObj) return queueItemObj