|
|
@@ -3706,7 +3706,7 @@ class DeepSeekService
|
|
|
$isChanged = $this->isEpisodeResourceChanged($existingMap[$itemKey], $item, $nameKey);
|
|
|
|
|
|
if (!$isChanged) {
|
|
|
- // nameKey 和 description 一致,继承现有项的 URL
|
|
|
+ // nameKey 和 description 一致,继承现有项的 URL、task_id 和 task_status
|
|
|
$mergedItem = [
|
|
|
$nameKey => trim((string)getProp($item, $nameKey)),
|
|
|
'description' => trim((string)getProp($item, 'description')),
|
|
|
@@ -3718,6 +3718,18 @@ class DeepSeekService
|
|
|
$mergedItem['url'] = $existingUrl;
|
|
|
}
|
|
|
|
|
|
+ // 继承现有项的 task_id
|
|
|
+ $existingTaskId = getProp($existingMap[$itemKey], 'task_id');
|
|
|
+ if (!empty($existingTaskId)) {
|
|
|
+ $mergedItem['task_id'] = $existingTaskId;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 继承现有项的 task_status
|
|
|
+ $existingTaskStatus = getProp($existingMap[$itemKey], 'task_status');
|
|
|
+ if (!empty($existingTaskStatus)) {
|
|
|
+ $mergedItem['task_status'] = $existingTaskStatus;
|
|
|
+ }
|
|
|
+
|
|
|
// 保留生成项的音色字段
|
|
|
$voiceName = getProp($item, 'voice_name');
|
|
|
if (!empty($voiceName)) {
|
|
|
@@ -3736,7 +3748,7 @@ class DeepSeekService
|
|
|
|
|
|
$merged[] = $mergedItem;
|
|
|
} else {
|
|
|
- // nameKey 或 description 不一致,重置 URL 但保留音色字段
|
|
|
+ // nameKey 或 description 不一致,重置 URL、task_id 和 task_status,但保留音色字段
|
|
|
$mergedItem = [
|
|
|
$nameKey => trim((string)getProp($item, $nameKey)),
|
|
|
'description' => trim((string)getProp($item, 'description')),
|
|
|
@@ -3758,12 +3770,12 @@ class DeepSeekService
|
|
|
$mergedItem['voice_audio_url'] = $audioUrl;
|
|
|
}
|
|
|
|
|
|
- // 不继承 URL(重置状态)
|
|
|
+ // 不继承 URL、task_id 和 task_status(重置状态)
|
|
|
$merged[] = $mergedItem;
|
|
|
}
|
|
|
} else {
|
|
|
// 新增项,保留生成项的所有字段
|
|
|
- $merged[] = $this->resetEpisodeResourceItem($item, $nameKey, ['voice_name', 'voice_type', 'voice_audio_url']);
|
|
|
+ $merged[] = $this->resetEpisodeResourceItem($item, $nameKey, ['url', 'task_id', 'task_status', 'voice_name', 'voice_type', 'voice_audio_url']);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -3777,12 +3789,6 @@ class DeepSeekService
|
|
|
'description' => trim((string)getProp($item, 'description')),
|
|
|
];
|
|
|
|
|
|
- // 如果生成项本身有URL,保留它
|
|
|
- $url = getProp($item, 'url');
|
|
|
- if (!empty($url)) {
|
|
|
- $resetItem['url'] = $url;
|
|
|
- }
|
|
|
-
|
|
|
// 保留指定的字段
|
|
|
foreach ($preserveFields as $field) {
|
|
|
$value = getProp($item, $field);
|