start_time_ts计算问题

This commit is contained in:
Jerry Yan 2022-05-01 10:39:51 +08:00
parent 5be88e1dc5
commit 143367c29e

View File

@ -109,7 +109,7 @@ def collect_danmaku_files(workflow: Optional[Workflow]):
if start_time_ts is None: if start_time_ts is None:
if clip.duration is None or clip.duration == 0: if clip.duration is None or clip.duration == 0:
clip.duration = get_video_real_duration(clip.full_path) clip.duration = get_video_real_duration(clip.full_path)
start_time_ts = datetime.now().timestamp() - clip.duration start_time_ts = datetime.now().timestamp() - float(clip.duration)
for danmaku_file in glob(os.path.join(XIGUALIVE_RECORDER_DIRECTORY, "*.xml")): for danmaku_file in glob(os.path.join(XIGUALIVE_RECORDER_DIRECTORY, "*.xml")):
relpath = os.path.relpath(danmaku_file, XIGUALIVE_RECORDER_DIRECTORY) relpath = os.path.relpath(danmaku_file, XIGUALIVE_RECORDER_DIRECTORY)
danmaku = DanmakuClip.query.filter( danmaku = DanmakuClip.query.filter(