feat: 更新房间位置映射表,修改标题为海宁齐总
This commit is contained in:
1 parent
504410f7b9
commit
d1f675073f
6 files changed
+34
-14
No files matched your search
@@ -1,2 +1,2 @@
|
||||
pos,title,title_raw
|
||||
0,哙小,哙~小
|
||||
0,海宁齐总,海宁齐总
|
||||
|
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"0": [
|
||||
"哙小",
|
||||
"哙~小"
|
||||
"海宁齐总",
|
||||
"海宁齐总"
|
||||
],
|
||||
"_meta": {
|
||||
"source": "C:\\Users\\12742\\Desktop\\douyin_guaji-main\\douyin\\core\\state\\room_pos_map.json",
|
||||
"generated_ts": 1768465088,
|
||||
"generated_ts": 1768465103,
|
||||
"run_id": "20260115161806"
|
||||
}
|
||||
}
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
| 位置 | 标题 | 原始标题 |
|
||||
|-:|:-|:-|
|
||||
| 0 | 哙小 | 哙~小 |
|
||||
| 0 | 海宁齐总 | 海宁齐总 |
|
||||
@@ -1128,7 +1128,7 @@ def attend_choujiang(analyser) -> bool:
|
||||
"参与", "点击指定位置或关闭详情页失败", error=str(e)
|
||||
)
|
||||
|
||||
# 重新诊断阶段,确认是否还在粉丝团加入页
|
||||
# 重新诊断阶段,确认是否还在粉丝团加入页
|
||||
try:
|
||||
# 删除:避免重复阶段诊断,减少截图/adb开销
|
||||
st_after, seen_after = "", ""
|
||||
|
||||
@@ -925,7 +925,9 @@ def _dump_room_pos_map_to_state(analyser: Any) -> None:
|
||||
with open(csv_tmp, "w", encoding="utf-8", newline="") as cf:
|
||||
writer = csv.writer(cf)
|
||||
writer.writerow(["pos", "title", "title_raw"])
|
||||
for k in sorted(filtered.keys(), key=lambda x: int(x) if x.isdigit() else x):
|
||||
for k in sorted(
|
||||
filtered.keys(), key=lambda x: int(x) if x.isdigit() else x
|
||||
):
|
||||
v = filtered.get(k, ["", ""]) or ["", ""]
|
||||
writer.writerow([k, v[0], v[1]])
|
||||
try:
|
||||
@@ -938,7 +940,9 @@ def _dump_room_pos_map_to_state(analyser: Any) -> None:
|
||||
mf.write(f"<!-- source: {final_path} -->\n\n")
|
||||
mf.write("| 位置 | 标题 | 原始标题 |\n")
|
||||
mf.write("|-:|:-|:-|\n")
|
||||
for k in sorted(filtered.keys(), key=lambda x: int(x) if x.isdigit() else x):
|
||||
for k in sorted(
|
||||
filtered.keys(), key=lambda x: int(x) if x.isdigit() else x
|
||||
):
|
||||
v = filtered.get(k, ["", ""]) or ["", ""]
|
||||
title = v[0].replace("|", "\\|")
|
||||
title_raw = v[1].replace("|", "\\|")
|
||||
|
||||
+22
-6
@@ -426,11 +426,19 @@ def main():
|
||||
import path_config as _pc
|
||||
|
||||
candidates = [
|
||||
os.path.join(_pc.PROJECT_ROOT, "douyin", "core", "state", "room_pos_map.json"),
|
||||
os.path.join(os.getcwd(), "douyin", "core", "state", "room_pos_map.json"),
|
||||
os.path.join(
|
||||
_pc.PROJECT_ROOT, "douyin", "core", "state", "room_pos_map.json"
|
||||
),
|
||||
os.path.join(
|
||||
os.getcwd(), "douyin", "core", "state", "room_pos_map.json"
|
||||
),
|
||||
]
|
||||
except Exception:
|
||||
candidates = [os.path.join(os.getcwd(), "douyin", "core", "state", "room_pos_map.json")]
|
||||
candidates = [
|
||||
os.path.join(
|
||||
os.getcwd(), "douyin", "core", "state", "room_pos_map.json"
|
||||
)
|
||||
]
|
||||
for p in candidates:
|
||||
try:
|
||||
if os.path.exists(p):
|
||||
@@ -458,7 +466,10 @@ def main():
|
||||
|
||||
mapping_tree.delete(*mapping_tree.get_children())
|
||||
try:
|
||||
keys = sorted([k for k in data.keys()], key=lambda x: int(x) if str(x).isdigit() else x)
|
||||
keys = sorted(
|
||||
[k for k in data.keys()],
|
||||
key=lambda x: int(x) if str(x).isdigit() else x,
|
||||
)
|
||||
except Exception:
|
||||
keys = list(data.keys())
|
||||
|
||||
@@ -2839,14 +2850,19 @@ def main():
|
||||
|
||||
if not parsed:
|
||||
# 非JSON或解析错误:在表格中显示原始文本的一行提示
|
||||
mapping_tree.insert("", "end", values=("-", "(非JSON,查看原始文件)", ""))
|
||||
mapping_tree.insert(
|
||||
"", "end", values=("-", "(非JSON,查看原始文件)", "")
|
||||
)
|
||||
else:
|
||||
# 移除元信息
|
||||
if isinstance(parsed, dict) and "_meta" in parsed:
|
||||
parsed.pop("_meta", None)
|
||||
# 按数字顺序插入
|
||||
try:
|
||||
keys = sorted(parsed.keys(), key=lambda x: int(x) if str(x).isdigit() else x)
|
||||
keys = sorted(
|
||||
parsed.keys(),
|
||||
key=lambda x: int(x) if str(x).isdigit() else x,
|
||||
)
|
||||
except Exception:
|
||||
keys = list(parsed.keys())
|
||||
for k in keys:
|
||||
|
||||
Reference in new issue
Block a user