Эх сурвалжийг харах

兼容个性语音修改默认值

zhangdongming 2 жил өмнө
parent
commit
5560a462e2

+ 1 - 1
Controller/UidSetController.py

@@ -427,7 +427,7 @@ class UidSetView(View):
         end_time = request_dict.get('end_time', None)
         repeat_day = request_dict.get('repeat_day', None)
         direction = request_dict.get('direction', None)
-        algorithm_type = int(request_dict.get('algorithmType', 0))
+        algorithm_type = int(request_dict.get('algorithmType', 99))
 
         if uid and channel:
             channel = int(channel)

+ 3 - 4
Controller/VoicePromptController.py

@@ -64,12 +64,11 @@ class VoicePromptView(View):
         uid = request_dict.get('uid', None)
         channel = request_dict.get('channel', None)
         type = request_dict.get('type', None)
-        algorithm_type = request_dict.get('algorithmType', None)
+        algorithm_type = int(request_dict.get('algorithmType', 99))
 
         if upload_type and uid and channel:
             vp_qs = VoicePromptModel.objects.filter(uid=uid, channel=channel, type=type)
-            if algorithm_type:
-                vp_qs.filter(algorithm_type=int(algorithm_type))
+            vp_qs = vp_qs.filter(algorithm_type=algorithm_type)
             count = vp_qs.count()
             if count >= 3:
                 return response.json(201)
@@ -178,7 +177,7 @@ class VoicePromptView(View):
         uid = request_dict.get('uid', None)
         channel = request_dict.get('channel', None)
         # 个性语音增加算法类型区分默认0兼容老版本
-        algorithm_type = int(request_dict.get('algorithmType', 0))
+        algorithm_type = int(request_dict.get('algorithmType', 99))
 
         if uid and channel and lang:
             voice_qs = VoicePromptModel.objects.filter(uid=uid, channel=channel, classification=1,