Skip to content

Commit

Permalink
fix: pass params to MediaFile constructor for correct init
Browse files Browse the repository at this point in the history
See cordova-plugin-file.File constructor for previously missing attributes, like 'lastModified' and 'end'.
  • Loading branch information
ath0mas committed Jul 30, 2023
1 parent 3ce9948 commit a18c56a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions www/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ function wrapMediaFiles (pluginResult) {
const mediaFiles = [];
let i;
for (i = 0; i < pluginResult.length; i++) {
const mediaFile = new MediaFile();
mediaFile.name = pluginResult[i].name;

// Backwards compatibility
mediaFile.localURL = pluginResult[i].localURL || pluginResult[i].fullPath;
const mediaFile = new MediaFile(
pluginResult[i].name,
// Backwards compatibility
pluginResult[i].localURL || pluginResult[i].fullPath,
pluginResult[i].type,
pluginResult[i].lastModifiedDate,
pluginResult[i].size
);
mediaFile.fullPath = pluginResult[i].fullPath;
mediaFile.type = pluginResult[i].type;
mediaFile.lastModifiedDate = pluginResult[i].lastModifiedDate;
mediaFile.size = pluginResult[i].size;
mediaFiles.push(mediaFile);
}
return mediaFiles;
Expand Down

0 comments on commit a18c56a

Please sign in to comment.