Commit 933e34ab by 杨昕

test

parent bd223f54
Pipeline #18786 passed with stages
in 2 minutes 20 seconds
......@@ -347,9 +347,10 @@ class MediaController extends Controller
$data = handler_drive(function () use ($request) {
SrsHookValidate::srsHookCallback($request, [
'media_id' => 'required',
'screenshot' => 'required',
'width' => 'required',
'height' => 'required',
'screenshot' => '',
'width' => '',
'height' => '',
'type' => 'required',
]);
return MediaModel::UpdateScreenShotInfo($request);
});
......
......@@ -1111,13 +1111,19 @@ class MediaModel extends Eloquent
/**
* @param $request
* @return array
* @return void
* @throws DatabaseException
*/
public static function UpdateScreenShotInfo($request)
{
LogModel::addlog(["接收到更新 screenshot 数据回调 " => $request->all()]);
$media_id = $request->media_id;
if ($request->type == 'audio'){
$data["media_audio"] = 'audio';
MediaModel::where("_id", $media_id)->update($data);
return;
}
try {
MediaModel::select("_id", "media_name", "duration", "secret_key", "media_url")->where('_id', $media_id)->first();
} catch (\Exception $exception) {
......@@ -1143,7 +1149,8 @@ class MediaModel extends Eloquent
try {
$match = [
'status' => "1",
"screen_shot" => null
"screen_shot" => null,
"media_audio" => ["\$ne" => 'audio']
];
if (isset($request->media_id) && !empty($request->media_id)) {
......@@ -1162,7 +1169,6 @@ class MediaModel extends Eloquent
$media = MediaModel::where($match)->first();
self::getScreeShotInfo($media["_id"]);
//sleep(10);
} catch (\Exception $exception) {
throw new DatabaseException($exception->getMessage());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment