modify scripts

This commit is contained in:
2025-12-25 16:11:30 +08:00
parent 3b5edd4b81
commit 274c187e18

View File

@ -195,7 +195,7 @@ def generate_union_table(mysql_conn):
key_str = parse_union_key(row["release_date"], row["studio_name"], row["whisper_code"])
if key_str not in dict_whisper_data:
dict_whisper_data[key_str] = set()
dict_whisper_data[key_str].add(idx)
dict_whisper_data[key_str].add(row['whisper_code'].lower() if row['whisper_code'] else "")
# 4. 内存中进行双边匹配
result = []
@ -210,6 +210,8 @@ def generate_union_table(mysql_conn):
if w['release_date'] and w['studio_name']:
# 对name进行去空格去特殊字符处理
key_str = parse_union_key(w['release_date'], w['studio_name'], w['whisper_code'])
whisper_codes = dict_whisper_data.get(key_str, set())
'''
if w['release_date'] == '2012-08-31' and w['studio_name'] == 'HEYZO':
print(f"whisper data: {w}")
print(f'key_str: {key_str}')
@ -217,7 +219,7 @@ def generate_union_table(mysql_conn):
set_idx = dict_stash_data[key_str]
for idx in set_idx:
print(f"stash data: {stash_data[idx]}")
'''
if key_str in dict_stash_data:
set_idx = dict_stash_data[key_str]
for idx in set_idx:
@ -229,6 +231,8 @@ def generate_union_table(mysql_conn):
if not matched:
# 否则匹配第一个未匹配过的
for idx in set_idx:
if stash_data[idx]['code'].lower() in whisper_codes:
continue
if not stash_data[idx].get('matched', False):
s = stash_data[idx]
stash_data[idx]['matched'] = True