exclude users from index

This commit is contained in:
Сергей Маринкевич
2026-06-08 12:12:54 +07:00
parent b83d4f8b9b
commit 3196c8e35c
+5 -1
View File
@@ -12,7 +12,8 @@ import mm_users
def iter_result_files(root: str) -> Iterable[str]:
for dirpath, _dirnames, filenames in os.walk(root):
for name in filenames:
if name.endswith(".json"):
if name == "users.json" or not name.endswith(".json"):
continue
yield os.path.join(dirpath, name)
@@ -132,6 +133,9 @@ def load_posts(path: str) -> Optional[Tuple[Dict[str, Any], List[Dict[str, Any]]
except (OSError, json.JSONDecodeError):
return None
if not isinstance(data, dict):
return None
channel_obj = data.get("channel")
posts = data.get("posts")
if not isinstance(channel_obj, dict) or not isinstance(posts, list):