'Adds a processing task to the queue
:param directory: directory to process
:param filename: release/nzb name if available
:param method: processing method, copy/move/symlink/link
:param force: force overwriting of existing files regardless of quality
:param is_priority: whether to replace the file even if it exists at higher quality
:param delete: delete files and folders after they are processed (always happens with move and auto combination)
:param failed: mark downloads as failed if they fail to process
:param mode: processing type: auto/manual
:param force_next: wait until the current item in the queue is finished, acquire the lock and process this task now, so we can return the result
:return: string indicating success or failure'

def add_item(self, directory, filename=None, method=None, force=False, is_priority=None, delete=None, failed=False, mode=u'auto', force_next=False):

    replacements = dict(mode=mode.title(), directory=directory)
    if (not directory):
        return log_helper(u'{mode}    post-processing    attempted    but    directory    is    not    set:    {directory}'.format(**replacements), logger.WARNING)
    if (not ek(os.path.isabs, directory)):
        return log_helper(u'{mode}    post-processing    attempted    but    directory    is    relative    (and    probably    not    what    you    really    want    to    process):    {directory}'.format(**replacements), logger.WARNING)
    item = self.find_in_queue(directory, mode)
    if (not delete):
        delete = (False, ((not sickbeard.NO_DELETE), True)[(method == u'move')])[(mode == u'auto')]
    if item:
        if (self.currentItem == item):
            return log_helper(u'{directory}    is    already    being    processed    right    now,    please    wait    until    it    completes    before    trying    again'.format(**replacements))
        item.set_params(directory, filename, method, force, is_priority, delete, failed, mode)
        message = log_helper(u'A    task    for    {directory}    was    already    in    the    processing    queue,    updating    the    settings    for    that    task'.format(**replacements))
        return (message + u"<br\\><span    class='hidden'>Processing    succeeded</span>")
    else:
        item = PostProcessorTask(directory, filename, method, force, is_priority, delete, failed, mode)
        if force_next:
            with self.lock:
                item.run()
                message = item.last_result
            return message
        else:
            super(ProcessingQueue, self).add_item(item)
            message = log_helper(u'{mode}    post    processing    task    for    {directory}    was    added    to    the    queue'.format(**replacements))
            return (message + u"<br\\><span    class='hidden'>Processing    succeeded</span>")
