From 34543ea34b0d03874eab99e05035fc2379743a47 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Thu, 13 Apr 2023 15:34:36 +0530 Subject: [PATCH] video issue --- api/application/controllers/PD_Controller.php | 30 +++++++++---------- .../helpers/video_grabber_helper.php | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 47263925..14aff16e 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -9237,23 +9237,23 @@ class PD_Controller extends REST_Controller if ($value['composition_id'] && $value['vsp'] != 'google') { $res = $this->twlio->getCompositionStatus($value['composition_id']); - // if (count($res) && $res['status'] == 'completed') { + if (count($res) && $res['status'] == 'completed') { - // // $is_copied = $this->copyMediaFromTwiloToS3($pd_master_details, $value, $pd_category); // copy media from twlio s3 to our s3 - // // $fields_to_update = array('twilo_status' => 'completed'); - // // if ($is_copied) { - // // $fields_to_update['s3_copied'] = 1; - // // } - // $id = $this->PD_Model->updateRecords($fields_to_update, VIDEO_ROOM_INFO, array('video_room_info_id' => $value['video_room_info_id'])); + // $is_copied = $this->copyMediaFromTwiloToS3($pd_master_details, $value, $pd_category); // copy media from twlio s3 to our s3 + $fields_to_update = array('twilo_status' => 'completed'); + // if ($is_copied) { + // $fields_to_update['s3_copied'] = 1; + // } + $id = $this->PD_Model->updateRecords($fields_to_update, VIDEO_ROOM_INFO, array('video_room_info_id' => $value['video_room_info_id'])); - // if ($id) { - // if ($room_id) { - // $result_data = $is_copied; - // } else { - // $result_data++; - // } - // } - // } + if ($id) { + if ($room_id) { + $result_data = $is_copied; + } else { + $result_data++; + } + } + } } else { $room_status = $this->twlio->getRoomDataByRoomID($value['room_id']); if ($room_status == 'completed') { diff --git a/api/application/helpers/video_grabber_helper.php b/api/application/helpers/video_grabber_helper.php index 476b9571..0e7c1af1 100644 --- a/api/application/helpers/video_grabber_helper.php +++ b/api/application/helpers/video_grabber_helper.php @@ -40,7 +40,7 @@ class video_grabber_helper if($value['is_uploaded'] || $value['vsp'] == 'google'){$video_name = $value['composition_id'];} $file_name = $video_name; - if($value['s3_copied']) + if($value['twilo_status'] == 'completed') { // $final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$file_name; $final_key = $file_name;