feat(words): единый источник csv_words — wordquiz, bubblewords, pronunciation + CRUD

This commit is contained in:
2026-09-30 12:17:15 +00:00
parent 2d82d615c7
commit 6d0d1b5001
4 changed files with 202 additions and 34 deletions
+5 -6
View File
@@ -123,14 +123,13 @@ async def get_next_bubble_level(request: Request):
else:
num_words = random.choice([7, 8])
# Запрос слов с фильтром по уровню и level_id IS NULL
# 🔧 ФИКС (30.09.2026): csv_words_source —
# источник слов переехал с level_words (старая схема level_id IS NULL)
# на csv_words (level_code). Один источник — CSV-база.
words = await conn.fetch("""
SELECT word_pl, translation_ru, translation_uk, translation_en
FROM (
SELECT DISTINCT ON (word_pl) word_pl, translation_ru, translation_uk, translation_en
FROM level_words
WHERE level = $1 AND level_id IS NULL
) AS unique_words
FROM csv_words
WHERE level_code = $1
ORDER BY RANDOM()
LIMIT $2
""", current_level, num_words)