fix: 声纹页面修复 - 移除broken quotes+暂时跳过tags查询
This commit is contained in:
parent
51ea4096aa
commit
afae286434
@ -36,26 +36,6 @@ try:
|
||||
# 查出入介质标签(从标签表中取出来),按 doc_id 编组
|
||||
doc_ids = [r["id"] for r in rows]
|
||||
doc_tags = {}
|
||||
if doc_ids:
|
||||
try:
|
||||
id_list = ','.join(["'" + str(x) + "'" for x in doc_ids])
|
||||
mt_recs = await sor.sqlExe(
|
||||
"SELECT mt.media_id, t.name, t.color FROM media_tags mt " +
|
||||
"JOIN tags t ON mt.tag_id=t.id " +
|
||||
"WHERE mt.media_type='document' AND mt.media_id IN (" + id_list + ")",
|
||||
ns={})
|
||||
for mt in mt_recs:
|
||||
doc_tags.setdefault(mt.media_id, []).append({"name": mt.name, "color": mt.color or '#3b82f6'})
|
||||
except:
|
||||
pass
|
||||
if doc_ids:
|
||||
mt_recs = await sor.sqlExe(
|
||||
"SELECT mt.media_id, t.name, t.color FROM media_tags mt "
|
||||
"JOIN tags t ON mt.tag_id=t.id "
|
||||
"WHERE mt.media_type='document' AND mt.media_id IN (${ids}$)",
|
||||
{"ids": doc_ids})
|
||||
for mt in mt_recs:
|
||||
doc_tags.setdefault(mt.media_id, []).append({"name": mt.name, "color": mt.color or '#3b82f6'})
|
||||
for r in rows:
|
||||
r["media_tags"] = doc_tags.get(r["id"], [])
|
||||
except Exception:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user