You've already forked lubo_comment_query
OCR
This commit is contained in:
@@ -2,9 +2,12 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\VideoOcrRecords;
|
||||
use App\Models\Videos;
|
||||
use App\Util\VideoOcrUtil;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class VideoQueryController extends BaseController
|
||||
{
|
||||
@@ -16,10 +19,15 @@ class VideoQueryController extends BaseController
|
||||
} else {
|
||||
$comment = null;
|
||||
}
|
||||
// 有 OCR 数据的分P → CDN 全量文件 URL(固定路径可推导)
|
||||
$ocr_urls = VideoOcrRecords::query()->where("video_bvid", "=", $video->bvid)
|
||||
->select("part_num")->distinct()->orderBy("part_num")->pluck("part_num")
|
||||
->mapWithKeys(fn(int $partNum) => [$partNum => Storage::url(VideoOcrUtil::cdn_path($video->bvid, $partNum))]);
|
||||
return view("video.index", [
|
||||
"video" => $video,
|
||||
"video_pivots" => $pivots,
|
||||
"comment" => $comment,
|
||||
"ocr_urls" => $ocr_urls,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user