ath0mas opened a new pull request #195:
URL: https://github.com/apache/cordova-plugin-media-capture/pull/195


   ### Platforms affected
   www
   
   
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   Returned MediaFiles objects for captured media are missing `lastModified` 
(_null_) and `end` (_0_).
   
   
   ### Description
   <!-- Describe your changes in detail -->
   The 
[helpers.wrapMediaFiles](https://github.com/ath0mas/cordova-plugin-media-capture/blob/master/www/helpers.js#L28)
 method is using the MediaFile empty constructor, and attributes are set 
afterward.
   But given [MediaFile 
constructor](https://github.com/ath0mas/cordova-plugin-media-capture/blob/master/www/MediaFile.js#L36)
 is simply calling its parent [cordova-plugin-file.File 
constructor](https://github.com/apache/cordova-plugin-file/blob/master/www/File.js#L31),
 we can understand that some File attributes will never be redefined properly.
   
   Directly calling the constructor with all the params values resolves this 
problem in a clean manner.
   
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   Returned MediaFiles objects now have correct `lastModified` === 
`lastModifiedDate`, and `end` === `size`.
   
   
   ### Checklist
   
   - [ ] I've run the tests to see all new and existing tests pass
   - [ ] I added automated test coverage as appropriate for this change
   - [ ] Commit is prefixed with `(platform)` if this change only applies to 
one platform (e.g. `(android)`)
   - [ ] If this Pull Request resolves an issue, I linked to the issue in the 
text above (and used the correct [keyword to close issues using 
keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to