|
@@ -50,13 +50,20 @@ def best_choice(params_obj, request_param, trace_id):
|
|
|
print(e)
|
|
|
sorted_list = sorted(score_list, key=lambda x: x[1], reverse=True)
|
|
|
return sorted_list[0]
|
|
|
-
|
|
|
- best_search_tuple = best_video_id(search_list)
|
|
|
- if best_search_tuple[1] > 0:
|
|
|
- return best_search_tuple[0]
|
|
|
+ if search_list:
|
|
|
+ best_search_tuple = best_video_id(search_list)
|
|
|
+ if best_search_tuple[1] > 0:
|
|
|
+ return best_search_tuple[0]
|
|
|
+ else:
|
|
|
+ best_pq_tuple = best_video_id(pq_list)
|
|
|
+ if best_pq_tuple[1] > 0:
|
|
|
+ return best_pq_tuple[0]
|
|
|
+ else:
|
|
|
+ return None
|
|
|
else:
|
|
|
best_pq_tuple = best_video_id(pq_list)
|
|
|
if best_pq_tuple[1] > 0:
|
|
|
return best_pq_tuple[0]
|
|
|
else:
|
|
|
return None
|
|
|
+
|