Чистка репозитория: удалены неиспользуемые картинки + упрощён prewarm

Удалены изображения от удалённых фич (карусель услуг, карьера, веб-форма):
service_1/2/3/5/6/7.jpg, career_player/worker.jpg, bg.jpg. Остался только Logo.jpg
(приветствие). _prewarm_media упрощён — грузит только логотип.

pytest 36 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Kenik
2026-07-26 10:31:51 +03:00
parent 348b944638
commit f1c984ed69
10 changed files with 6 additions and 15 deletions
+6 -15
View File
@@ -1285,23 +1285,14 @@ class VKBotApplication:
return info["attachment"] if info else None
def _prewarm_media(self):
"""Заранее (при старте) загружает логотип и картинки дисциплин в VK,
чтобы первое приветствие и первая карусель открывались мгновенно."""
import os, glob
"""Заранее (при старте) загружает логотип в VK, чтобы приветствие открывалось мгновенно."""
import os
try:
peer = config.OPERATOR_PEER_ID
base = os.path.join(os.path.dirname(__file__), "help_img")
# Грузим ВСЕ картинки из папки (кроме фона веб-формы), чтобы ничего
# не подгружалось лениво в момент сообщения.
count = 0
for path in sorted(glob.glob(os.path.join(base, "*.jpg"))):
if os.path.basename(path).lower() == "bg.jpg":
continue
if self._upload_photo(peer, path):
count += 1
logger.info(f"Медиа предзагружены в VK ({count} картинок) — открываются мгновенно.")
logo = os.path.join(os.path.dirname(__file__), "help_img", "Logo.jpg")
if self._upload_photo(config.OPERATOR_PEER_ID, logo):
logger.info("Логотип предзагружен в VK — приветствие открывается мгновенно.")
except Exception as e:
logger.error(f"Не удалось предзагрузить медиа: {e}")
logger.error(f"Не удалось предзагрузить логотип: {e}")
# ---------- Вебинар «Точка входа в киберспорт» ----------
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB