Open ghost opened 7 years ago
I can see your point.
The thing is I took the authorization code from piwigo core action.php
.
Maybe I missed something, but it doesn't seem like the core code skip this check for any file type.
So I don't think it wise to skip it by default.
Also your solution in theory will only work with 'mp4' files explicitly (not even MP4) which as common as it might be won't cover all use cases where skipping the derivative process might be necessary.
If there is no existing piwigo setting to solve this issue, I would suggest adding a setting -
piwigo_privacy_no_derivative
which will be array of extensions which does not have derivative and original can be served.
The check should verify the extension of the file is exactly as the extension in the list (if user wants both upper case and lower case extension it should add both of them).
Please not that you have a bug in the test which will actually cause it to skip any file unless it starts with '.mp4' which is definitely not what we want.
Thanks for the comments. I like the idea of having that setting to control the extensions that have no derivatives generated. I will rework this code then.
This PR allows to serve directly the videos instead of trying to create derivates. They would fail to serve videos, since yo don't need either the full resolution permission or a derivative.