def METHOD_NAME(self, task, config):
    """Add downloaded movies to the database"""
    logger.debug('check for learning')
    for entry in task.accepted:
        if 'imdb_id' not in entry:
            logger.debug('`{}` does not have imdb_id', entry['title'])
            continue
        parser = plugin.get('parsing', self).parse_movie(entry['title'])
        quality = parser.quality.name
        logger.debug('quality: {}', quality)
        logger.debug('imdb_id: {}', entry['imdb_id'])
        logger.debug('proper count: {}', parser.proper_count)
        proper_movie = (
            task.session.query(ProperMovie)
            .filter(ProperMovie.imdb_id == entry['imdb_id'])
            .filter(ProperMovie.quality == quality)
            .filter(ProperMovie.proper_count == parser.proper_count)
            .first()
        )
        if not proper_movie:
            pm = ProperMovie()
            pm.title = entry['title']
            pm.task = task.name
            pm.imdb_id = entry['imdb_id']
            pm.quality = quality
            pm.proper_count = parser.proper_count
            task.session.add(pm)
            logger.debug('added {}', pm)
        else:
            logger.debug('{} already exists', proper_movie)