feat: počítání sdílených médií v týdenním i měsíčním přehledu

This commit is contained in:
2026-06-15 19:11:10 +02:00
parent 4da5e6790c
commit 8d6393adf7
2 changed files with 43 additions and 4 deletions
+7
View File
@@ -82,7 +82,13 @@ def main():
tag_counts = {}
candidates = []
media_count = {"image": 0, "video": 0, "gifv": 0, "audio": 0, "total": 0}
for toot in timeline:
for att in toot.get("media_attachments", []):
att_type = att.get("type", "")
media_count["total"] += 1
if att_type in media_count:
media_count[att_type] += 1
if toot.get("language") != "cs":
continue
if "@" in toot.get("account", {}).get("acct", ""):
@@ -151,6 +157,7 @@ def main():
"top": top,
"tags": tags,
"top_links": top_links,
"media_count": media_count,
}, f, ensure_ascii=False, indent=2)
print(f"Uloženo: {out_path} ({len(timeline)} tootů načteno, {len(top)} top, {len(tags)} hashtagů)")