Skip to content

Configurable maximum sizes (MiB) for video upload and thumbnail upload

Merge Request Guidelines

  1. Please fill this form out to the best of your ability.
  2. Follow the principle of "One Merge Request, One Concern"
  3. Merge Requests must be complete in total.
  4. Contributed Code must be universal in scope, ie: Able to be used for all installs / install environments.

Description

This is for "maximum video upload file size" and "maximum thumbnail upload file size" (both in MiB) for video uploads to be configurable via the Admin panel, and having that influence the appropriate sections of the site - e.g. the video upload and thumbnail upload modals. Also a fix to the "Upload a New Thumbnail" modal where the Cancel and Save buttons could be hidden, and thus difficult if not impossible to click on.

Motivation and Context

  • This allows for "maximum video upload file size" and "maximum thumbnail upload file size" (both in MiB) for video uploads to be configurable via the Admin panel, to allow for MP4 video larger than 4 GiB, and PNG thumbnails larger than 8 MiB, to be uploaded to an OSP site.
  • There was a layout issue with the "Upload a New Thumbnail" modal, where the footer containing the Cancel/Save buttons was partially obscured by the file name display and image upload progress bar.

How Has This Been Tested?

The tests were done on an OSP site created specifically for internal testing of patches for OSP.

Tests:

  • Confirmed that the footer of the "Upload a new Thumbnail" modal is fully visible.
  • Admin Settings - Maximum Video Upload File Size (MiB) and Maximum Video Thumbnail File Size (MiB)
    • Confirmed that those two values are initialized with the default values of 4096 and 8 respectively.
    • Confirmed that those two values cannot have values less than 1.
    • Confirmed that "Save" will save those values.
  • Video Upload modal
    • Confirmed that the two values display in the "(Max size: [xxx] MiB)" labels for the video file upload and thumbnail file uploads.
    • Confirmed that the error message "Error: File is too big ( MiB). Max filesize: MiB." is shown for both file uploads.
    • Confirmed that the upload chunks for a video are each 1048576 bytes in size now (1 MiB) - thus, a video with 9.12 MiB will have a total chunk count of 10 MiB.
    • Confirmed that the upload chunks for a thumbnail are each 1048576 bytes in size now (1 MiB).
    • Confirmed that the video upload process works; with and without thumbnail.
  • Thumbnail Upload modal
    • Confirmed that the modal's footer is fully displayed, and not blocked by the modal's body.
    • Confirmed that the "max thumbnail size" value displays in the "(Max size: [xxx] MiB)" label for the thumbnail file upload.
    • Confirmed that the error message "Error: File is too big ( MiB). Max filesize: MiB." is shown for thumbnail uploads.
    • Confirmed that the upload chunks for a thumbnail are each 1048576 bytes in size now (1 MiB).
    • Confirmed that the thumbnail upload process works.

Screenshots (if appropriate):

image_01_max_file_size_labels Showing the labels to display the maximum file sizes for video and thumbnail uploads, as well as how the video upload max size is now 10240 GiB instead of 4096 MiB.

image_02_max_file_size_label Showing the "max thumbnail size" label, displaying the configured maximum of 1 MiB, and a failed thumbnail upload complete with error message.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • Merge Request Follows the Merge Request Guidelines
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
Edited by Kenneth Larson

Merge request reports