sync update from LAN repo (source master @ ca48c4ec)

This commit is contained in:
gozeros committed 2026-11-05 10:53:54 +08:00
1 parent 8bc8b0e082
commit ea9dcff9c0
873 files changed
+107866 -14011

No files matched your search

@@ -109,6 +109,7 @@ class SkillRepository(SkillStore):
row.published = bool(data["published"])
if "detail" in data:
row.detail = data["detail"]
row.detail_preview = (str(data["detail"] or "")[:1024] or None)
if "name_zh" in data:
row.name_zh = data["name_zh"]
if "always_on" in data:
@@ -131,6 +132,7 @@ class SkillRepository(SkillStore):
row.owner_user_id = data["owner_user_id"]
if "detail" in data:
row.detail = data["detail"]
row.detail_preview = (str(data["detail"] or "")[:1024] or None)
if "name_zh" in data:
row.name_zh = data["name_zh"]
if "always_on" in data:
@@ -183,6 +185,20 @@ class SkillRepository(SkillStore):
result = await session.execute(stmt)
return {row[0] for row in result.all()}
async def list_name_zh(self, names: list[str]) -> dict[str, str]:
wanted = list(dict.fromkeys(name for name in names if name))
if not wanted:
return {}
stmt = select(SkillRow.name, SkillRow.name_zh).where(SkillRow.name.in_(wanted))
async with self._sf() as session:
rows = (await session.execute(stmt)).all()
labels: dict[str, str] = {}
for name, name_zh in rows:
label = (name_zh or "").strip()
if label:
labels[name] = label
return labels
async def list_favorite_skill_names(self, user_id: str) -> set[str]:
stmt = select(SkillFavoriteRow.skill_name).where(SkillFavoriteRow.user_id == user_id)
async with self._sf() as session: