예제 #1
0
파일: db.py 프로젝트: Jarcol/sicksubs
def get_sid(conn, tvdbid):
    with conn:
        c = conn.cursor()
        c.execute(u'''SELECT sid FROM sids WHERE tvdbid = ?''', (tvdbid,))
        result = c.fetchone()
        if not result:
            # not in db, we have to get it from bierdopje
            sid = bierdopje.get_show_id(tvdbid)
            if sid:
                c.execute(u'''INSERT INTO sids VALUES (?, ?)''', (tvdbid, sid))
            result = sid
        else:
            result = result[0]
        return result
예제 #2
0
파일: sicksubs.py 프로젝트: Jarcol/sicksubs
def update_tvdbids(sids, tvdbid):
    if tvdbid not in sids:
        sid = bierdopje.get_show_id(tvdbid)
        sids[tvdbid] = sid
    return sids