|
@@ -44,6 +44,8 @@ def video_position_recommend(mid, uid, app_type, videos):
|
|
|
pos1_vids = filted_list[0]
|
|
|
pos2_vids = filted_list[1]
|
|
|
|
|
|
+ videos = positon_duplicate(pos1_vids, pos2_vids, videos)
|
|
|
+
|
|
|
if pos1_vids is not None and len(pos1_vids) >0 :
|
|
|
videos.insert(0, {'videoId': int(pos1_vids[0]), 'rovScore': 100,
|
|
|
'pushFrom': config_.PUSH_FROM['position_insert'], 'abCode': config_.AB_CODE['position_insert']})
|
|
@@ -54,6 +56,21 @@ def video_position_recommend(mid, uid, app_type, videos):
|
|
|
return videos[:10]
|
|
|
|
|
|
|
|
|
+def positon_duplicate(pos1_vids, pos2_vids, videos):
|
|
|
+ s = set()
|
|
|
+ if pos1_vids is not None and len(pos1_vids) >0:
|
|
|
+ s.add(int(pos1_vids[0]))
|
|
|
+ if pos2_vids is not None and len(pos2_vids) >0:
|
|
|
+ s.add(int(pos2_vids[0]))
|
|
|
+
|
|
|
+ l = []
|
|
|
+ for i in range(len(videos)):
|
|
|
+ if videos[i]['videoId'] in s:
|
|
|
+ l.append(i)
|
|
|
+ for i in l:
|
|
|
+ videos.pop(i)
|
|
|
+ return videos
|
|
|
+
|
|
|
def video_recommend(mid, uid, size, app_type, algo_type, client_info):
|
|
|
"""
|
|
|
首页线上推荐逻辑
|