|
@@ -150,14 +150,17 @@ async def get_video_tag_info(
|
|
|
):
|
|
|
try:
|
|
|
tag = []
|
|
|
+ tag_lable = []
|
|
|
for info in get_video_tag_list(db,video_code):
|
|
|
tag_info = get_dict_data_info(db,info.dict_type,info.dict_value)
|
|
|
- tag.append({"id":info.id,
|
|
|
- "video_code":video_code,
|
|
|
- "dict_type":info.dict_type,
|
|
|
- "dict_value":info.dict_value,
|
|
|
- "dict_label":tag_info.dict_label,
|
|
|
- "dict_code":tag_info.dict_code})
|
|
|
+ if tag_info.dict_label not in tag_lable:
|
|
|
+ tag.append({"id":info.id,
|
|
|
+ "video_code":video_code,
|
|
|
+ "dict_type":info.dict_type,
|
|
|
+ "dict_value":info.dict_value,
|
|
|
+ "dict_label":tag_info.dict_label,
|
|
|
+ "dict_code":tag_info.dict_code})
|
|
|
+ tag_lable.append(tag_info.dict_label)
|
|
|
return {
|
|
|
"code": 200,
|
|
|
"msg": "成功",
|
|
@@ -174,6 +177,9 @@ async def add_video_tag(
|
|
|
db: Session = Depends(get_db)
|
|
|
):
|
|
|
try:
|
|
|
+ tag_info = get_dict_data_info(db, body['dict_type'], body['dict_value'])
|
|
|
+ if tag_info is None:
|
|
|
+ return JSONResponse(status_code=404,content={"code":404,"msg":"标签不存在"})
|
|
|
new_video_tag = TpVideoTag(
|
|
|
id = new_guid(),
|
|
|
video_code=body['video_code'],
|