views-count-fix
Some checks failed
Deploy on push / deploy (push) Failing after 7s

This commit is contained in:
2025-08-27 15:22:18 +03:00
parent 29f8625617
commit 32f1fab867
4 changed files with 32 additions and 23 deletions

View File

@@ -318,7 +318,9 @@ def get_shouts_with_links(
stat = orjson.loads(row.stat)
elif isinstance(row.stat, dict):
stat = row.stat
viewed = ViewedStorage.get_shout(shout_id=shout_id) or 0
# 🔎 Получаем views_count по slug, а не по id
shout_slug = shout_dict.get("slug", "")
viewed = ViewedStorage.get_shout(shout_slug=shout_slug) or 0
shout_dict["stat"] = {**stat, "views_count": viewed}
# Обработка main_topic и topics