浏览代码

goods_art_no_arrays

rambo 1 周之前
父节点
当前提交
5aeabfc370
共有 1 个文件被更改,包括 17 次插入2 次删除
  1. 17 2
      python/api.py

+ 17 - 2
python/api.py

@@ -518,7 +518,22 @@ async def _process_cutout(run_main, config_data, goods_art_no_arrays, move_folde
     """处理抠图"""
     handler_result = []
     handler_result_folder = ""
-    
+    have_handler_keys = move_folder_array.keys()
+    if len(have_handler_keys) >0 :
+        progress = {
+                    "status":"正在处理",
+                    "current":len(have_handler_keys),
+                    "total":len(goods_art_no_arrays),
+                    "error":0,
+                    "goods_art_no":have_handler_keys
+                    }
+        await sendAsyncMessage(
+            msg="正在处理",
+            data=None,
+            status="正在处理",
+            msg_type="segment_progress",
+            progress=progress
+        )
     return_data = run_main.check_before_cutout(config_data)
     cutout_res = run_main.check_for_cutout_image_first_call_back(return_data)
     
@@ -533,7 +548,7 @@ async def _process_cutout(run_main, config_data, goods_art_no_arrays, move_folde
                 "info": "处理成功",
             })
             
-    if len(move_folder_array.keys()) == len(goods_art_no_arrays):
+    if len(have_handler_keys) == len(goods_art_no_arrays):
         handler_result_folder = handler_result_folder.replace("\\", "/")
         success_items = [item for item in handler_result if item.get('success') == True]
         cutout_folder = handler_result_folder+"/"+success_items[0].get("goods_art_no")+"/800x800" if len(success_items) > 0 else ""