Преглед изворни кода

Merge branch 'top-video' into test

liqian пре 3 година
родитељ
комит
e52a429461
1 измењених фајлова са 9 додато и 5 уклоњено
  1. 9 5
      video_recall.py

+ 9 - 5
video_recall.py

@@ -398,13 +398,17 @@ class PoolRecall(object):
                 if self.client_info.get('cityCode') in city_code_list or config_.ALL_AREA_CODE in city_code_list:
                 if self.client_info.get('cityCode') in city_code_list or config_.ALL_AREA_CODE in city_code_list:
                     # log_.info('=== uid: {}, ===2=== {}, ===3=== video_id: {}, cityCode: {}'.format(
                     # log_.info('=== uid: {}, ===2=== {}, ===3=== video_id: {}, cityCode: {}'.format(
                     #     self.uid, self.client_info.get('cityCode'), video_id, city_code_list))
                     #     self.uid, self.client_info.get('cityCode'), video_id, city_code_list))
-                    if video_id in video_ids and item['score'] > video_info[video_id].get('score'):
+                    if video_id in video_ids:
                         # 如果video_id有重复,score保留大分值
                         # 如果video_id有重复,score保留大分值
-                        video_info[video_id] = {'score': item['score'], 'cityCode': city_code_list}
+                        if item['score'] > video_info[video_id].get('score'):
+                            video_info[video_id] = {'score': item['score'], 'cityCode': city_code_list}
+                        else:
+                            continue
                     else:
                     else:
-                        continue
-                    video_ids.append(video_id)
-                    video_info[video_id] = {'score': item['score'], 'cityCode': city_code_list}
+                        video_ids.append(video_id)
+                        video_info[video_id] = {'score': item['score'], 'cityCode': city_code_list}
+                else:
+                    continue
 
 
             # 过滤
             # 过滤
             filter_ = FilterVideos(app_type=self.app_type, video_ids=video_ids, mid=self.mid, uid=self.uid)
             filter_ = FilterVideos(app_type=self.app_type, video_ids=video_ids, mid=self.mid, uid=self.uid)