[Sprint/SillySheep](feat): Added ability for admins to manually transcode a video. #2237
- Closes front#2237
- Depends on front!671
Summary
Adding in an option for admins to retranscode a video manually.
Testing
- Log in as admin (ask if you don't have the password) - refresh.
- Get a video, or post a video
- Check the dropdown menu
- You should see retranscode as an option
- Open your browser console on the XHR/Requests tab
- Click it, check v2/admin/transcode is called and returns success.
- Non admins and not logged in should NOT see the retranscode option.
note Transcoding on sandboxes may not work, you may need to manually run the transcoder queue if its not up.
Using kubectl to gain access to the sandbox container, enter the engine dir, and run
php ./cli.php QueueRunner run --runner=Transcoder
0/3
threads resolved
added scoped label
mentioned in merge request front!671
unmarked as a Work In Progress
changed the description
added scoped label
29 */ 30 public function post($pages) 31 { 32 $guid = intval($_POST['guid']); 33 34 if (!$guid) { 35 return Factory::response(['status' => 'error', 'message' => 'You must send a GUID.']); 36 } 37 38 $entity = Entities\EntitiesFactory::build($guid); 39 40 if (!$entity) { 41 return Factory::response(['status' => 'error', 'message' => 'Entity not found.']); 42 } 43 44 $user = $entity->getOwnerEntity(); - Owner
remove
37 38 $entity = Entities\EntitiesFactory::build($guid); 39 40 if (!$entity) { 41 return Factory::response(['status' => 'error', 'message' => 'Entity not found.']); 42 } 43 44 $user = $entity->getOwnerEntity(); 45 46 if (!$user) { 47 return Factory::response(['status' => 'error', 'message' => 'User not found.']); 48 } 49 50 $videoManager = new Manager(); 51 52 if (!$videoManager->queueTranscoding($guid, $user->isPro())) { - Owner
change to
transcode($entity)
and let the manager do the$user->isPro()
check.
70 75 71 76 return $url; 72 77 } 78 79 80 /** 81 * Add a video to the transcoding queue 82 * 83 * @param Integer $guid - the guid of the video. 84 * @param boolean $fullhd - whether to transcode full_hd. 85 * @return boolean true if video added to transcode queue. 86 */ 87 public function queueTranscoding($guid, $fullhd = false) - Owner
return type needed
added scoped label and automatically removed label