lh 3 månader sedan
förälder
incheckning
9a61e0edda
1 ändrade filer med 5 tillägg och 6 borttagningar
  1. 5 6
      app/Services/DeepSeek/DeepSeekService.php

+ 5 - 6
app/Services/DeepSeek/DeepSeekService.php

@@ -390,12 +390,6 @@ class DeepSeekService
         $version_id = getProp($data, 'version_id');
         $generate_json = getProp($data, 'generate_json');
 
-        // 判断是否有未生成字幕的段落
-        $no_subtitle_sequences = DB::table('mp_chapter_paragraph_audios')->where('bid', $bid)->where('cid', $cid)->where('version_id', $version_id)->whereNull('subtitle_info')->pluck('sequence')->toArray();
-        if ($no_subtitle_sequences) {
-            Utils::throwError('20003:请先将以下段落序号生成字幕('.implode('、', $no_subtitle_sequences).')');
-        }
-
         // 获取已生成的音频
         $paragraph_audios = DB::table('mp_chapter_paragraph_audios')->where('bid', $bid)->where('cid', $cid)->where('version_id', $version_id)->get();
 
@@ -505,6 +499,11 @@ class DeepSeekService
             $sequence++;
         }
         $generate_json = json_encode($words, 256);
+        // 判断是否有未生成字幕的段落
+        $no_subtitle_sequences = DB::table('mp_chapter_paragraph_audios')->where('bid', $bid)->where('cid', $cid)->where('version_id', $version_id)->whereIn('sequence', $complete_paragraph_sequences)->whereNull('subtitle_info')->pluck('sequence')->toArray();
+        if ($no_subtitle_sequences) {
+            Utils::throwError('20003:请先将以下段落序号生成字幕('.implode('、', $no_subtitle_sequences).')');
+        }
 
         try {
             DB::beginTransaction();