lh před 1 týdnem
rodič
revize
ed663ae612
1 změnil soubory, kde provedl 32 přidání a 0 odebrání
  1. 32 0
      app/Console/Commands/FixNewVideoTasks720pCommand.php

+ 32 - 0
app/Console/Commands/FixNewVideoTasks720pCommand.php

@@ -179,6 +179,38 @@ class FixNewVideoTasks720pCommand extends Command
 
 
                 $segmentSynced = $this->syncSegmentUrls($task, $newResult, $newCompressed);
                 $segmentSynced = $this->syncSegmentUrls($task, $newResult, $newCompressed);
                 $recordSynced = $this->syncAnimeRecordUrls($task, $newResult);
                 $recordSynced = $this->syncAnimeRecordUrls($task, $newResult);
+
+                // 只更新不新增;完全没有 assistant 记录时需要即时通知人工确认
+                if ($recordSynced === 0) {
+                    $assistantTotal = DB::table('mp_anime_records')
+                        ->where('video_task_id', $task->id)
+                        ->where('role', 'assistant')
+                        ->count();
+                    if ($assistantTotal === 0) {
+                        $notice = sprintf(
+                            '任务#%d 在 mp_anime_records 中完全没有 assistant 记录(只更新不新增),请人工确认是否需要补录',
+                            $task->id
+                        );
+                        $this->warn($notice);
+                        dLog('command')->warning($notice, [
+                            'task_id' => $task->id,
+                            'old_result_url' => $task->result_url,
+                            'new_result_url' => $newResult,
+                        ]);
+                        logDB('command', 'warning', $notice, [
+                            'task_id' => $task->id,
+                            'old_result_url' => $task->result_url,
+                            'new_result_url' => $newResult,
+                        ]);
+                    } else {
+                        $this->warn(sprintf(
+                            '任务#%d 有 %d 条 assistant 记录但均未指向旧 result_url,跳过 anime_records 同步',
+                            $task->id,
+                            $assistantTotal
+                        ));
+                    }
+                }
+
                 $this->line(sprintf(
                 $this->line(sprintf(
                     '#%d 已更新任务 URL(分镜同步:%s;anime_records 同步:%d 条)',
                     '#%d 已更新任务 URL(分镜同步:%s;anime_records 同步:%d 条)',
                     $task->id,
                     $task->id,