|
|
@@ -632,6 +632,14 @@ class AnimeService
|
|
|
$episode['acts'] = $segmentsStructure['acts'];
|
|
|
$episode['total_duration'] = $segmentsStructure['total_duration'];
|
|
|
|
|
|
+ // 获取mp_animes表中的视频参数
|
|
|
+ $anime = DB::table('mp_animes')->where('id', $anime_id)->first(['video_model', 'video_resolution', 'video_ratio']);
|
|
|
+ $episode['video_params'] = [
|
|
|
+ 'video_model' => getProp($anime, 'video_model'),
|
|
|
+ 'video_resolution' => getProp($anime, 'video_resolution'),
|
|
|
+ 'ratio' => getProp($anime, 'video_ratio'),
|
|
|
+ ];
|
|
|
+
|
|
|
return $episode;
|
|
|
}
|
|
|
|
|
|
@@ -8525,12 +8533,43 @@ class AnimeService
|
|
|
$ratio = getProp($data, 'ratio');
|
|
|
if (!$ratio) $ratio = '9:16';
|
|
|
|
|
|
- return DB::table('mp_anime_episodes')->where('id', $episode_id)->update([
|
|
|
- 'video_model' => $model,
|
|
|
- 'video_resolution' => $video_resolution,
|
|
|
- 'ratio' => $ratio,
|
|
|
- 'updated_at' => date('Y-m-d H:i:s')
|
|
|
- ]);
|
|
|
+ $episode = DB::table('mp_anime_episodes')->where('id', $episode_id)->first(['anime_id']);
|
|
|
+ if (!$episode) {
|
|
|
+ Utils::throwError('20003:分集不存在');
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ DB::beginTransaction();
|
|
|
+
|
|
|
+ $result = DB::table('mp_anime_episodes')->where('id', $episode_id)->update([
|
|
|
+ 'video_model' => $model,
|
|
|
+ 'video_resolution' => $video_resolution,
|
|
|
+ 'ratio' => $ratio,
|
|
|
+ 'updated_at' => date('Y-m-d H:i:s')
|
|
|
+ ]);
|
|
|
+ if ($result === false) {
|
|
|
+ Utils::throwError('20003:分集视频参数保存失败');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 同步更新mp_animes表
|
|
|
+ $anime_result = DB::table('mp_animes')->where('id', $episode->anime_id)->update([
|
|
|
+ 'video_model' => $model,
|
|
|
+ 'video_resolution' => $video_resolution,
|
|
|
+ 'video_ratio' => $ratio,
|
|
|
+ 'updated_at' => date('Y-m-d H:i:s')
|
|
|
+ ]);
|
|
|
+ if ($anime_result === false) {
|
|
|
+ Utils::throwError('20003:动漫视频参数保存失败');
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ DB::rollBack();
|
|
|
+ Utils::throwError('20003:'.$e->getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ DB::commit();
|
|
|
+
|
|
|
+ return $result;
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -8736,6 +8775,11 @@ class AnimeService
|
|
|
'title' => getProp($episode, 'title'),
|
|
|
'episode_number' => getProp($episode, 'episode_number'),
|
|
|
'is_generated' => getProp($episode, 'is_generated'),
|
|
|
+ 'video_params' => [
|
|
|
+ 'video_model' => getProp($episode, 'video_model'),
|
|
|
+ 'video_resolution' => getProp($episode, 'video_resolution'),
|
|
|
+ 'ratio' => getProp($episode, 'ratio'),
|
|
|
+ ],
|
|
|
'products' => $products,
|
|
|
'acts' => $return_acts
|
|
|
];
|