Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable size limit when uploading videos for a Jetpack site with VideoPress #11090

Merged
merged 4 commits into from
Feb 15, 2017

Conversation

donnapep
Copy link
Contributor

Ignore the maximum file upload size limitation when uploading a video for a VideoPress-enabled Jetpack site.

cc @dbtlr

@matticbot
Copy link
Contributor

@donnapep donnapep self-assigned this Jan 31, 2017
@donnapep donnapep added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 31, 2017
@dbtlr
Copy link
Contributor

dbtlr commented Feb 1, 2017

@donnapep: Looks pretty awesome. One thing that occurred to me after reading through the code is that we should also verify that the Jetpack version is >= 4.5, which is the release that enabled this type of uploading.

Great work otherwise!

@donnapep
Copy link
Contributor Author

donnapep commented Feb 1, 2017

@dbtlr You got it. I've added a commit for the Jetpack version check. Thx!

@donnapep
Copy link
Contributor Author

donnapep commented Feb 4, 2017

@aduth Mind giving a quick review of this one? Thx!

return null;
}

if ( site.jetpack && site.isModuleActive( 'videopress' ) && versionCompare( site.options.jetpack_version, '4.5', '>=' ) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few notes:

  • I'm not really familiar with isSupportedFileTypeInPremium. Is that enough to ensure that the file is a video, or at the very least one which can ignore file size limits?
  • When splitting condition on multiple lines, we should indent following lines (related guideline)
  • The JetpackSite prototype has a versionCompare method you can use as a convenience

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx! Fixed the last two and finding out about the first. Cheers.

@donnapep
Copy link
Contributor Author

donnapep commented Feb 7, 2017

Hey @artpi. As you originally added the isSupportedFileTypeInPremium function, any thoughts on @aduth's comment as to whether calling it is "enough to ensure that the file is a video, or at the very least one which can ignore file size limits"?

@dbtlr
Copy link
Contributor

dbtlr commented Feb 7, 2017

@donnapep: As I mentioned in my previous comment, that function is not going to be good enough, because we have to limit to videos. This function will allow other file types too that are not currently supported in this way.

We need something that checks the filesize AND that the file is mimetype video/*. Until Jetpack starts doing uploads to wpcom for the other file types, photos and such still need to be under the server filesize limit.

@donnapep
Copy link
Contributor Author

donnapep commented Feb 8, 2017

@dbtlr Sorry, missed that. The latest commit does the mime type check. Thx!

@dbtlr
Copy link
Contributor

dbtlr commented Feb 15, 2017

LGTM!

@donnapep donnapep merged commit ff3e76b into master Feb 15, 2017
@donnapep donnapep deleted the update/videopress-max-upload-size branch February 15, 2017 15:58
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants