SELECT rg.name FROM s_release_group rg JOIN artist_credit_name acn ON rg.artist_credit = acn.artist_credit WHERE acn.artist = %s UNION SELECT r.name FROM s_release r JOIN artist_credit_name acn ON r.artist_credit = acn.artist_credit WHERE acn.artist = %s """ processed = 0 skipped = 0 for id, gid, name in db.execute(query): processed += 1 if not contains_text_in_script(name, ['Hangul']): skipped += 1 db.execute("INSERT INTO bot_wp_artist_ko (gid) VALUES (%s)", (gid,)) continue print 'Looking up artist "%s" http://musicbrainz.org/artist/%s' % (name, gid) matches = wps.query(name, defType='dismax', qf='name', rows=50).results last_wp_request = time.time() for match in matches: title = match['name'] if title.endswith('album)') or title.endswith('song)'): continue if mangle_name(re.sub(' \(.+\)$', '', title)) != mangle_name(name) and mangle_name(title) != mangle_name(name): continue delay = time.time() - last_wp_request if delay < 1.0: time.sleep(1.0 - delay)
SELECT rg.name FROM s_release_group rg JOIN artist_credit_name acn ON rg.artist_credit = acn.artist_credit WHERE acn.artist = %s UNION SELECT r.name FROM s_release r JOIN artist_credit_name acn ON r.artist_credit = acn.artist_credit WHERE acn.artist = %s """ processed = 0 skipped = 0 for id, gid, name in db.execute(query): processed += 1 if not contains_text_in_script(name, ["Katakana", "Hiragana", "Han"]): skipped += 1 db.execute("INSERT INTO bot_wp_artist_ja (gid) VALUES (%s)", (gid,)) continue print 'Looking up artist "%s" http://musicbrainz.org/artist/%s' % (name, gid) matches = wps.query(name, defType="dismax", qf="name", rows=50).results last_wp_request = time.time() for match in matches: title = match["name"] if title.endswith("album)") or title.endswith("song)"): continue if mangle_name(re.sub(" \(.+\)$", "", title)) != mangle_name(name) and mangle_name(title) != mangle_name(name): continue delay = time.time() - last_wp_request if delay < 1.0: time.sleep(1.0 - delay)
SELECT rg.name FROM s_release_group rg JOIN artist_credit_name acn ON rg.artist_credit = acn.artist_credit WHERE acn.artist = %s UNION SELECT r.name FROM s_release r JOIN artist_credit_name acn ON r.artist_credit = acn.artist_credit WHERE acn.artist = %s """ processed = 0 skipped = 0 for id, gid, name in db.execute(query): processed += 1 if not contains_text_in_script(name, ['Katakana', 'Hiragana', 'Han']): skipped += 1 db.execute("INSERT INTO bot_wp_artist_ja (gid) VALUES (%s)", (gid,)) continue print 'Looking up artist "%s" http://musicbrainz.org/artist/%s' % (name, gid) matches = wps.query(name, defType='dismax', qf='name', rows=50).results last_wp_request = time.time() for match in matches: title = match['name'] if title.endswith('album)') or title.endswith('song)'): continue if mangle_name(re.sub(' \(.+\)$', '', title)) != mangle_name(name) and mangle_name(title) != mangle_name(name): continue delay = time.time() - last_wp_request if delay < 1.0: time.sleep(1.0 - delay)
SELECT rg.name FROM s_release_group rg JOIN artist_credit_name acn ON rg.artist_credit = acn.artist_credit WHERE acn.artist = %s UNION SELECT r.name FROM s_release r JOIN artist_credit_name acn ON r.artist_credit = acn.artist_credit WHERE acn.artist = %s """ processed = 0 skipped = 0 for id, gid, name in db.execute(query): processed += 1 if not contains_text_in_script(name, ['Katakana', 'Hiragana', 'Han']): skipped += 1 db.execute("INSERT INTO bot_wp_artist_ja (gid) VALUES (%s)", (gid, )) continue print 'Looking up artist "%s" http://musicbrainz.org/artist/%s' % (name, gid) matches = wps.query(name, defType='dismax', qf='name', rows=50).results last_wp_request = time.time() for match in matches: title = match['name'] if title.endswith('album)') or title.endswith('song)'): continue if mangle_name(re.sub(' \(.+\)$', '', title)) != mangle_name( name) and mangle_name(title) != mangle_name(name): continue delay = time.time() - last_wp_request