From 2ed7727ce3eb482c37b3edf1992d288bbfa7e89c Mon Sep 17 00:00:00 2001 From: SlyAimer <2289782085@qq.com> Date: Tue, 4 Mar 2025 23:29:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(clover=5Fimage):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E5=9B=BE=E7=89=87=E9=80=89=E5=8F=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了多余的随机选择代码 - 通过直接在返回语句中使用 random.choice() 来优化图片路径的随机选择 --- src/clover_image/get_image.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/clover_image/get_image.py b/src/clover_image/get_image.py index a6c0cbf..bacf496 100644 --- a/src/clover_image/get_image.py +++ b/src/clover_image/get_image.py @@ -13,7 +13,6 @@ async def get_image_names(): for file in files: if any(file.endswith(ext) for ext in image_extensions): # 检查文件是否是图片文件 image_names.append(file) - random.choice(image_names) # 随机选取一张图片 local_image_path = image_local_path + '/' + random.choice(image_names) # 随机选取一张图片的路径 return local_image_path