Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project overview
  • Repository
  • Issues 281
  • Merge Requests 38
  • CI / CD
  • Security & Compliance
  • Packages
  • Wiki
  • Snippets
  • Members
  • Collapse sidebar
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds Backend - EngineMinds Backend - Engine
  • Merge Requests
  • !402

Open
Opened 5 days ago by Ben Hayward@benhayward.ben
Report abuse

[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.

image

Testing

  1. Log in as admin (ask if you don't have the password) - refresh.
  2. Get a video, or post a video
  3. Check the dropdown menu
  4. You should see retranscode as an option
  5. Open your browser console on the XHR/Requests tab
  6. Click it, check v2/admin/transcode is called and returns success.
  1. 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

Edited 3 days ago by Ben Hayward
Request to merge feat/admin-manual-transcoding-2237 into master
The source branch is 19 commits behind the target branch
Open in Web IDE
Pipeline #97401522 passed for ff2ac6b3 on feat/admin-manual-transcoding-2237
          Requires 3 more approvals from Devs, Deployers, and QA.
          Olivia Madrid
          Olivia Madrid
          Mark Harding
          Mark Harding
          Rami Albatal
          Rami Albatal
          Marcelo Rivera
          Marcelo Rivera
          Guy Thouret
          Guy Thouret
          Ready to be merged automatically. Ask someone with write access to this repository to merge this request

          Closes front#2237

          Deletes source branch

          • Discussion 3
          • Commits 1
          • Pipelines 1
          • Changes 3
          0/3 threads resolved
          • Ben Hayward @benhayward.ben added Squad::Yellow scoped label 5 days ago

            added scoped label

          • Ben Hayward @benhayward.ben mentioned in merge request front!671 3 days ago

            mentioned in merge request front!671

          • Ben Hayward @benhayward.ben unmarked as a Work In Progress 3 days ago

            unmarked as a Work In Progress

          • Ben Hayward @benhayward.ben changed the description 3 days ago

            changed the description

          • Ben Hayward @benhayward.ben added MR::Awaiting Review scoped label 3 days ago

            added scoped label

          • Mark Harding
            Mark Harding @markeharding started a thread on the diff just now
            Controllers/api/v2/admin/transcode.php
            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();
            • Mark Harding
              Mark Harding @markeharding · just now
              Owner

              remove

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff just now
            Controllers/api/v2/admin/transcode.php
            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())) {
            • Mark Harding
              Mark Harding @markeharding · just now
              Owner

              change to transcode($entity) and let the manager do the $user->isPro() check.

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff just now
            Core/Media/Video/Manager.php
            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)
            • Mark Harding
              Mark Harding @markeharding · just now
              Owner

              return type needed

            • Please register or sign in to reply
          • Mark Harding @markeharding added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label just now

            added scoped label and automatically removed label

          Please register or sign in to reply
          0 Assignees
          None
          None
          Milestone
          None
          Time tracking
          No estimate or time spent
          2
          Labels
          MR::Requires Changes Squad::Yellow
          Lock merge request
          Unlocked
          10
          10 participants
          user avatar
          Olivia Madrid
          user avatar
          Mark Harding
          user avatar
          Rami Albatal
          user avatar
          Marcelo Rivera
          user avatar
          Guy Thouret
          user avatar
          Emiliano Balbuena
          user avatar
          Martin Santangelo
          Reference: minds/engine!402