Merge pull request #1084 from A0000Xz/dev

修复对于古早缺失字段的图片反复生成新picid记录的BUG
This commit is contained in:
SengokuCola
2025-07-05 22:09:58 +08:00
committed by GitHub

View File

@@ -403,7 +403,16 @@ class ImageManager:
or existing_image.vlm_processed is None or existing_image.vlm_processed is None
): ):
logger.debug(f"图片记录缺少必要字段,补全旧记录: {image_hash}") logger.debug(f"图片记录缺少必要字段,补全旧记录: {image_hash}")
image_id = str(uuid.uuid4()) if not existing_image.image_id:
existing_image.image_id = str(uuid.uuid4())
if existing_image.count is None:
existing_image.count = 0
if existing_image.vlm_processed is None:
existing_image.vlm_processed = False
existing_image.count += 1
existing_image.save()
return existing_image.image_id, f"[picid:{existing_image.image_id}]"
else: else:
# print(f"图片已存在: {existing_image.image_id}") # print(f"图片已存在: {existing_image.image_id}")
# print(f"图片描述: {existing_image.description}") # print(f"图片描述: {existing_image.description}")