zhangdongming 10 месяцев назад
Родитель
Сommit
c0f874dd01
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      Controller/DetectControllerV2.py

+ 2 - 1
Controller/DetectControllerV2.py

@@ -115,7 +115,8 @@ class DetectControllerViewV2(View):
             target_key = f'channel{channel}'
             # 初始化存在标志
             channel_found = False
-            new_data = {target_key: list(map(int, event_types.split(',')))}
+            # 使用 map() 和条件表达式
+            new_data = {target_key: list(map(int, event_types.split(','))) if event_types else []}
             # 检查 msg_notify 是否存在且包含 'nvr'
             if msg_notify and 'nvr' in msg_notify: