重命名表情包和图像模型中的哈希字段,统一为 emoji_hash 和 image_description_hash,以提高代码一致性
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user