liqian 2 yıl önce
ebeveyn
işleme
ece4f490f6
1 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  1. 3 2
      video_rank.py

+ 3 - 2
video_rank.py

@@ -265,8 +265,9 @@ def bottom_strategy2(size, app_type, mid, uid, ab_code, client_info, params):
         # 过滤
         filter_ = FilterVideos(request_id=params.request_id, app_type=app_type, mid=mid, uid=uid, video_ids=video_ids)
         filtered_data = filter_.filter_videos(pool_type='flow', region_code=region_code)
-        bottom_result = [{'videoId': int(video_id), 'pushFrom': config_.PUSH_FROM['bottom2'], 'abCode': ab_code}
-                         for video_id in filtered_data[:size]]
+        if filtered_data:
+            bottom_result = [{'videoId': int(video_id), 'pushFrom': config_.PUSH_FROM['bottom2'], 'abCode': ab_code}
+                             for video_id in filtered_data[:size]]
     return bottom_result