From 3196c8e35c2aed3d4be29b70c3006493cb36a76c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9C=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=D0=BA=D0=B5=D0=B2=D0=B8=D1=87?= Date: Mon, 8 Jun 2026 12:12:54 +0700 Subject: [PATCH] exclude users from index --- mm_index.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mm_index.py b/mm_index.py index 2b5fdbe..8539e7e 100644 --- a/mm_index.py +++ b/mm_index.py @@ -12,8 +12,9 @@ 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"): - yield os.path.join(dirpath, name) + if name == "users.json" or not name.endswith(".json"): + continue + yield os.path.join(dirpath, name) def parse_post_created(s: str) -> Optional[str]: @@ -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):