重命名表情包和图像模型中的哈希字段,统一为 emoji_hash 和 image_description_hash,以提高代码一致性

This commit is contained in:
墨梓柒
2025-05-16 17:08:30 +08:00
parent 9965997139
commit b698d17a76
3 changed files with 12 additions and 12 deletions

View File

@@ -61,7 +61,7 @@ class ImageManager:
"""
try:
record = ImageDescriptions.get_or_none(
(ImageDescriptions.hash == image_hash) & (ImageDescriptions.type == description_type)
(ImageDescriptions.image_description_hash == image_hash) & (ImageDescriptions.type == description_type)
)
return record.description if record else None
except Exception as e:
@@ -141,7 +141,7 @@ class ImageManager:
# 保存到数据库 (Images表)
try:
img_obj = Images.get((Images.hash == image_hash) & (Images.type == "emoji"))
img_obj = Images.get((Images.emoji_hash == image_hash) & (Images.type == "emoji"))
img_obj.path = file_path
img_obj.description = description
img_obj.timestamp = current_timestamp
@@ -214,7 +214,7 @@ class ImageManager:
# 保存到数据库 (Images表)
try:
img_obj = Images.get((Images.hash == image_hash) & (Images.type == "image"))
img_obj = Images.get((Images.emoji_hash == image_hash) & (Images.type == "image"))
img_obj.path = file_path
img_obj.description = description
img_obj.timestamp = current_timestamp