|
@@ -9,6 +9,7 @@ from applications.config import Config
|
|
|
from applications.log import logging
|
|
|
from applications.functions.pqFunctions import publish_to_pq, get_pq_video_detail
|
|
|
from applications.functions.common import shuffle_list
|
|
|
+from applications.match_algorithm.rank import get_content_oss_fission_dict
|
|
|
|
|
|
|
|
|
class historyContentIdTask(object):
|
|
@@ -83,6 +84,11 @@ class historyContentIdTask(object):
|
|
|
ORDER BY score DESC;
|
|
|
"""
|
|
|
res_tuple = await self.mysql_client.async_select(sql)
|
|
|
+ fission_dict = await get_content_oss_fission_dict(
|
|
|
+ db_client=self.mysql_client,
|
|
|
+ config=self.config,
|
|
|
+ content_id=content_id
|
|
|
+ )
|
|
|
if len(res_tuple) >= 3:
|
|
|
return [
|
|
|
{
|
|
@@ -91,7 +97,9 @@ class historyContentIdTask(object):
|
|
|
"like_count": i[2],
|
|
|
"video_oss_path": i[3],
|
|
|
"cover_oss_path": i[4],
|
|
|
- "uid": i[5]
|
|
|
+ "uid": i[5],
|
|
|
+ "fission_0_rate": fission_dict.get(i[3], {}).get("fission_0_rate", 0),
|
|
|
+ "fission_0_on_read": fission_dict.get(i[3], {}).get("fission_0_on_read", 0)
|
|
|
}
|
|
|
for i in res_tuple
|
|
|
]
|
|
@@ -160,8 +168,9 @@ class historyContentIdTask(object):
|
|
|
case "autoArticlePoolLevel2":
|
|
|
video_list = []
|
|
|
case "autoArticlePoolLevel1":
|
|
|
- # 头条,先不做
|
|
|
- video_list = download_videos[:3]
|
|
|
+ # 头条内容,使用重排后结果
|
|
|
+ sorted_videos = sorted(download_videos, key=lambda x: x['fission_0_rate'], reverse=True)
|
|
|
+ video_list = sorted_videos[:3]
|
|
|
case _:
|
|
|
print("未传流量池信息")
|
|
|
video_list = download_videos[:3]
|