fix 部分情况下视频不能正常显示
This commit is contained in:
parent
0341543ec9
commit
ab6925ce68
@ -207,9 +207,14 @@ def get_msg_list(MSG_db_path, selected_talker="", start_index=0, page_size=500):
|
|||||||
elif type_id == (43, 0): # 视频
|
elif type_id == (43, 0): # 视频
|
||||||
DictExtra = read_BytesExtra(BytesExtra)
|
DictExtra = read_BytesExtra(BytesExtra)
|
||||||
DictExtra = str(DictExtra)
|
DictExtra = str(DictExtra)
|
||||||
match = re.search(r"FileStorage(.*?)'", DictExtra)
|
|
||||||
if match:
|
DictExtra_str = str(DictExtra)
|
||||||
video_path = match.group(0).replace("'", "")
|
video_paths = [i for i in re.findall(r"(FileStorage.*?)'", DictExtra_str)]
|
||||||
|
video_paths = sorted(video_paths, key=lambda p: "mp4" in p, reverse=True)
|
||||||
|
if video_paths:
|
||||||
|
video_path = video_paths[0].replace("'", "")
|
||||||
|
video_path = [i for i in video_path.split("\\") if i]
|
||||||
|
video_path = os.path.join(*video_path)
|
||||||
content["src"] = video_path
|
content["src"] = video_path
|
||||||
else:
|
else:
|
||||||
content["src"] = ""
|
content["src"] = ""
|
||||||
|
@ -330,18 +330,18 @@ def get_real_time_msg():
|
|||||||
msg_paths.sort()
|
msg_paths.sort()
|
||||||
micro_paths = micro_paths[1]
|
micro_paths = micro_paths[1]
|
||||||
micro_paths.sort()
|
micro_paths.sort()
|
||||||
# for i in media_paths:
|
for i in media_paths:
|
||||||
# print(i)
|
print(i)
|
||||||
# merge_real_time_db(key=key, db_path=i, merge_path=save_media_path)
|
merge_real_time_db(key=key, db_path=i, merge_path=save_media_path)
|
||||||
# for i in msg_paths:
|
for i in msg_paths:
|
||||||
# print(i)
|
print(i)
|
||||||
# merge_real_time_db(key=key, db_path=i, merge_path=save_msg_path)
|
merge_real_time_db(key=key, db_path=i, merge_path=save_msg_path)
|
||||||
# for i in micro_paths:
|
for i in micro_paths:
|
||||||
# print(i)
|
print(i)
|
||||||
# merge_real_time_db(key=key, db_path=i, merge_path=save_micro_path)
|
merge_real_time_db(key=key, db_path=i, merge_path=save_micro_path)
|
||||||
merge_real_time_db(key=key, db_path=media_paths[-1], merge_path=save_media_path)
|
# merge_real_time_db(key=key, db_path=media_paths[-1], merge_path=save_media_path)
|
||||||
merge_real_time_db(key=key, db_path=msg_paths[-1], merge_path=save_msg_path)
|
# merge_real_time_db(key=key, db_path=msg_paths[-1], merge_path=save_msg_path)
|
||||||
merge_real_time_db(key=key, db_path=micro_paths[-1], merge_path=save_micro_path)
|
# merge_real_time_db(key=key, db_path=micro_paths[-1], merge_path=save_micro_path)
|
||||||
return ReJson(0, "success")
|
return ReJson(0, "success")
|
||||||
|
|
||||||
|
|
||||||
@ -380,6 +380,7 @@ def get_img():
|
|||||||
@api.route('/api/video/<path:videoPath>', methods=["GET", 'POST'])
|
@api.route('/api/video/<path:videoPath>', methods=["GET", 'POST'])
|
||||||
def get_video(videoPath):
|
def get_video(videoPath):
|
||||||
wx_path = read_session(g.sf, "wx_path")
|
wx_path = read_session(g.sf, "wx_path")
|
||||||
|
videoPath = videoPath.replace("\\\\", "\\")
|
||||||
all_video_path = os.path.join(wx_path, videoPath)
|
all_video_path = os.path.join(wx_path, videoPath)
|
||||||
if not os.path.exists(all_video_path):
|
if not os.path.exists(all_video_path):
|
||||||
return ReJson(5002)
|
return ReJson(5002)
|
||||||
|
Loading…
Reference in New Issue
Block a user