def METHOD_NAME(self, task, config):
    if not config:
        return
    identified_by = (
        '{{ media_id }}' if config['identified_by'] == 'auto' else config['identified_by']
    )
    grouped_entries = group_entries(task.accepted, identified_by)
    if not grouped_entries:
        return
    action_on_waiting = (
        entry_actions[config['on_waiting']] if config['on_waiting'] != 'do_nothing' else None
    )
    action_on_reached = (
        entry_actions[config['on_reached']] if config['on_reached'] != 'do_nothing' else None
    )
    with Session() as session:
        # Prefetch Data
        existing_ids = (
            session.query(EntryTimeFrame)
            .filter(EntryTimeFrame.id.in_(grouped_entries.keys()))
            .all()
        )
        existing_ids = {e.id: e for e in existing_ids}
        for identifier, entries in grouped_entries.items():
            if not entries:
                continue
            id_timeframe = existing_ids.get(identifier)
            if not id_timeframe:
                id_timeframe = EntryTimeFrame()
                id_timeframe.id = identifier
                id_timeframe.status = 'waiting'
                id_timeframe.first_seen = datetime.now()
                session.add(id_timeframe)
            if id_timeframe.status == 'accepted':
                logger.debug(
                    'Previously accepted {} with {} skipping', identifier, id_timeframe.title
                )
                continue
            # Sort entities in order of quality and best proper
            entries.sort(key=lambda e: (e['quality'], e.get('proper_count', 0)), reverse=True)
            best_entry = entries[0]
            logger.debug(
                'Current best for identifier {} is {}', identifier, best_entry['title']
            )
            id_timeframe.title = best_entry['title']
            id_timeframe.quality = best_entry['quality']
            id_timeframe.proper_count = best_entry.get('proper_count', 0)
            # Check we hit target or better
            target_requirement = qualities.Requirements(config['target'])
            target_quality = qualities.Quality(config['target'])
            if (
                target_requirement.allows(best_entry['quality'])
                or best_entry['quality'] >= target_quality
            ):
                logger.debug(
                    'timeframe reach target quality {} or higher for {}',
                    target_quality,
                    identifier,
                )
                if action_on_reached:
                    action_on_reached(best_entry, 'timeframe reached target quality or higher')
                continue
            # Check if passed wait time
            expires = id_timeframe.first_seen + parse_timedelta(config['wait'])
            if expires <= datetime.now():
                logger.debug(
                    'timeframe expired, releasing quality restriction for {}', identifier
                )
                if action_on_reached:
                    action_on_reached(best_entry, 'timeframe wait expired')
                continue
            # Verbose waiting, add to backlog
            if action_on_waiting:
                for entry in entries:
                    action_on_waiting(entry, 'timeframe waiting')
            diff = expires - datetime.now()
            hours, remainder = divmod(diff.seconds, 3600)
            hours += diff.days * 24
            minutes, _ = divmod(remainder, 60)
            logger.info(
                '`{}`: timeframe waiting for {:02d}h:{:02d}min. Currently best is `{}`.',
                identifier,
                hours,
                minutes,
                best_entry['title'],
            )
            # add best entry to backlog (backlog is able to handle duplicate adds)
            plugin.get('backlog', self).add_backlog(task, best_entry, session=session)