避免重复添加同一个弹幕

This commit is contained in:
Jerry Yan 2022-11-28 10:29:26 +08:00
parent 75f36a0ca7
commit e99552e1d4

View File

@ -138,6 +138,12 @@ def collect_danmaku_files(workflow: Optional[Workflow]):
DanmakuClip.file == relpath,
DanmakuClip.base_path == BILILIVE_RECORDER_DIRECTORY
).first()
if danmaku is None:
if len(clip.danmaku_clips) > 0:
for _danmaku in clip.danmaku_clips:
if _danmaku.file == relpath:
danmaku = _danmaku
break
if danmaku is None:
try:
start_time_ts = get_file_start(danmaku_file)