'Get the backlogged episodes'

def run(self):

    shows = []
    main_db_con = db.DBConnection(row_type=u'dict')
    for curShow in sickbeard.showList:
        show_eps = []
        sql_results = main_db_con.select(u'SELECT    tv_episodes.*,    tv_shows.paused    FROM    tv_episodes    INNER    JOIN    tv_shows    ON    tv_episodes.showid    =    tv_shows.indexer_id    WHERE    showid    =    ?    and    paused    =    0    ORDER    BY    season    DESC,    episode    DESC', [curShow.indexerid])
        for curResult in sql_results:
            cur_ep_cat = curShow.getOverview(curResult['status'])
            if (cur_ep_cat and (cur_ep_cat in (Overview.WANTED, Overview.QUAL))):
                show_eps.append(curResult)
        if show_eps:
            shows.append({u'indexerid': curShow.indexerid, u'show_name': curShow.name, u'status': curShow.status, u'episodes': show_eps})
    return _responds(RESULT_SUCCESS, shows)
