diff --git a/app/Http/Controllers/ProgramConstructController.php b/app/Http/Controllers/ProgramConstructController.php
index 8e582ab..4d1d701 100644
--- a/app/Http/Controllers/ProgramConstructController.php
+++ b/app/Http/Controllers/ProgramConstructController.php
@@ -108,7 +108,7 @@ class ProgramConstructController extends BaseController
"content" => $e->getMessage()
]);
}
- ProgramVideoUtil::fix_created_at_by_part_info($bvid);
+ ProgramVideoUtil::fix_created_at_by_part_info($bvid, true);
return redirect(route("program.construct.list"));
}
diff --git a/app/Http/Controllers/ProgramVideoConstructController.php b/app/Http/Controllers/ProgramVideoConstructController.php
index b81ca40..d652893 100644
--- a/app/Http/Controllers/ProgramVideoConstructController.php
+++ b/app/Http/Controllers/ProgramVideoConstructController.php
@@ -107,7 +107,7 @@ class ProgramVideoConstructController extends BaseController
"id" => "没有开始时间,请先保存对应时间"
]);
}
- return view("program.construct.video.time_fix", [
+ return view("program.construct.video.manual_fix", [
"program_video" => $program_video
]);
}
@@ -127,4 +127,16 @@ class ProgramVideoConstructController extends BaseController
ProgramVideoUtil::fix_created_at_by_manual($program_video, $each_time_sec);
return redirect(route("program.construct.list"));
}
+
+ public function auto_fix_created_at(Request $request, string $bvid)
+ {
+ $result = ProgramVideoUtil::fix_created_at_by_part_info($bvid, true);
+ if ($result) {
+ return redirect(route("program.construct.list"));
+ } else {
+ return back()->withErrors([
+ "video_bvid" => "自动修复失败"
+ ]);
+ }
+ }
}
diff --git a/app/Util/ProgramVideoUtil.php b/app/Util/ProgramVideoUtil.php
index 54940c6..ac97aac 100644
--- a/app/Util/ProgramVideoUtil.php
+++ b/app/Util/ProgramVideoUtil.php
@@ -86,6 +86,7 @@ class ProgramVideoUtil
$program_video->stop_part = $video_parts->pluck("part_num")->max();
}
}
+ $program_video->save();
}
}
DB::commit();
diff --git a/resources/views/program/construct/video/create.blade.php b/resources/views/program/construct/video/create.blade.php
index 41cd549..f90a1ba 100644
--- a/resources/views/program/construct/video/create.blade.php
+++ b/resources/views/program/construct/video/create.blade.php
@@ -51,7 +51,7 @@
- @if($program_video->video_bvid)
+ @if($program_video->video)
@endif
diff --git a/resources/views/program/construct/video/manual_fix.blade.php b/resources/views/program/construct/video/manual_fix.blade.php
new file mode 100644
index 0000000..588aa77
--- /dev/null
+++ b/resources/views/program/construct/video/manual_fix.blade.php
@@ -0,0 +1,40 @@
+
+
+
+ 录播节目关联视频位置修改
+
+
+
+
+@include("common.header")
+
+@include("common.footer")
+
+
diff --git a/routes/web.php b/routes/web.php
index 685f630..a88b052 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -48,8 +48,9 @@ Route::prefix("/programs/construct")->middleware("auth:web")->group(function (Ro
$router->post("/{program}/video/add", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","create"])->name("program.construct.video.create");
$router->get("/video/{program_video}", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","edit"])->name("program.construct.video.edit");
$router->post("/video/{program_video}", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","submit"])->name("program.construct.video.submit");
- $router->get("/video/{program_video}/batch_fix", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","to_fix_created_at"])->name("program.construct.video.batch_fix_created_at");
- $router->post("/video/{program_video}/batch_fix", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","fix_created_at_base_on"])->name("program.construct.video.batch_fix_created_at.submit");
+ $router->get("/video/{program_video}/manual_fix", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","to_fix_created_at"])->name("program.construct.video.manual_fix_created_at.view");
+ $router->post("/video/{program_video}/manual_fix", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","fix_created_at_base_on"])->name("program.construct.video.manual_fix_created_at");
+ $router->get("/video/fix/{bvid}", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","auto_fix_created_at"])->name("program.construct.video.auto_fix_created_at");
// 节目关联点播建设
$router->get('/{program}/append', ["\\App\\Http\\Controllers\\ProgramAppendConstructController","index"])->name("program.construct.append.list");
$router->get('/{program}/append/add', ["\\App\\Http\\Controllers\\ProgramAppendConstructController","add"])->name("program.construct.append.add");