Commit 933e34ab by 杨昕

test

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