'Captures the current input then replaces it with entries that have passed the delay.'

@plugin.priority((-1))
def on_task_input(self, task, config):

    if task.entries:
        log.verbose((u'Delaying    %s    new    entries    for    %s' % (len(task.entries), config)))
        task.no_entries_ok = True
    expire_time = (datetime.now() + self.get_delay(config))
    for entry in task.entries:
        log.debug((u'Delaying    %s' % entry[u'title']))
        if (not task.session.query(DelayedEntry).filter((DelayedEntry.title == entry[u'title'])).filter((DelayedEntry.task == task.name)).first()):
            delay_entry = DelayedEntry()
            delay_entry.title = entry[u'title']
            delay_entry.entry = entry
            delay_entry.task = task.name
            delay_entry.expire = expire_time
            task.session.add(delay_entry)
    task.all_entries[:] = []
    passed_delay = task.session.query(DelayedEntry).filter((datetime.now() > DelayedEntry.expire)).filter((DelayedEntry.task == task.name))
    delayed_entries = [item.entry for item in passed_delay.all()]
    for entry in delayed_entries:
        entry[u'passed_delay'] = True
        log.debug((u'Releasing    %s' % entry[u'title']))
    passed_delay.delete()
    if delayed_entries:
        log.verbose((u'Restoring    %s    entries    that    have    passed    delay.' % len(delayed_entries)))
    return delayed_entries
