Browse Source

根据设备类型过滤设备音频

linhaohong 5 tháng trước cách đây
mục cha
commit
f62f4591f6
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      Controller/VoicePromptController.py

+ 5 - 1
Controller/VoicePromptController.py

@@ -192,7 +192,11 @@ class VoicePromptView(View):
                                                             algorithm_type=algorithm_type)
             if lang == 'cn' and algorithm_type == 10:
                 device_type = Device_Info.objects.filter(UID=uid).values('Type').first()['Type']
-                system_qs = system_qs.filter(Q(device_types=[]) | Q(device_types__contains=[device_type]))
+                system_new_qs = system_qs.filter(Q(device_types__contains=[device_type]))
+                if system_new_qs.exists():
+                    system_qs = system_new_qs
+                else:
+                    system_qs = system_qs.filter(Q(device_types=[]))
 
             channel_qs = UidChannelSetModel.objects.filter(uid__uid=uid, channel=channel,
                                                            algorithm_type=algorithm_type)