From 981c0a443cfb8fb11fa6aa5288bb41ed5907967a Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Fri, 18 Nov 2022 13:40:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8D=E9=87=8D=E5=A4=8D=E6=8A=8A?= =?UTF-8?q?=E5=BC=B9=E5=B9=95=E5=8E=8B=E8=BF=9B=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/api/bilirecorder_blueprint.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/controller/api/bilirecorder_blueprint.py b/controller/api/bilirecorder_blueprint.py index 83ee66d..812b1ba 100644 --- a/controller/api/bilirecorder_blueprint.py +++ b/controller/api/bilirecorder_blueprint.py @@ -100,10 +100,12 @@ def safe_create_item(): if bili_record_workflow_item is None: bili_record_workflow_item = Workflow() elif bili_record_workflow_item.id is not None: - bili_record_workflow_item.editing = False - commit_item() - auto_submit_task() - bili_record_workflow_item = Workflow() + bili_record_workflow_item.editing = False + if bili_record_workflow_item.name is None: + bili_record_workflow_item.name = VIDEO_TITLE.format(datetime.utcnow().strftime("%Y%m%d")) + commit_item() + auto_submit_task() + bili_record_workflow_item = Workflow() else: bili_record_workflow_item.name = VIDEO_TITLE.format(datetime.utcnow().strftime("%Y%m%d")) bili_record_workflow_item.automatic = True @@ -165,6 +167,14 @@ def collect_danmaku_files(workflow: Optional[Workflow]): if bias < -600: print("弹幕文件", danmaku_file, "反向偏移超过10分钟") continue + if len(clip.danmaku_clips) > 0: + matched = False + for d in clip.danmaku_clips: + if relpath == d.file: + matched = True + break + if matched: + continue danmaku = DanmakuClip() danmaku.file = relpath danmaku.base_path = XIGUALIVE_RECORDER_DIRECTORY