'Learn succeeded episodes'

def on_task_learn(self, task, config):

    log.debug(u'on_task_learn')
    for entry in task.accepted:
        if (u'series_releases' in entry):
            with Session() as session:
                season_num = ep_num = 0
                if entry[u'season_pack']:
                    season_num = session.query(SeasonRelease).filter(SeasonRelease.id.in_(entry[u'series_releases'])).update({u'downloaded': True}, synchronize_session=False)
                else:
                    ep_num = session.query(EpisodeRelease).filter(EpisodeRelease.id.in_(entry[u'series_releases'])).update({u'downloaded': True}, synchronize_session=False)
            log.debug(u'marking    %s    episode    releases    and    %s    season    releases    as    downloaded    for    `%s`', ep_num, season_num, entry)
        else:
            log.debug(u'`%s`    is    not    a    series', entry[u'title'])
