exclude users from index

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