Fixed upload for files shared to ente for backup

This commit is contained in:
Neeraj Gupta 2021-08-31 13:50:32 +05:30
parent a6a52a29c4
commit 70526a4157

View file

@ -131,12 +131,16 @@ class File {
}
metadata["fileType"] = fileType.index;
final asset = await getAsset();
fileSubType = asset.subTypes;
metadata["subType"] = fileSubType;
if (fileType == FileType.video) {
duration = asset.duration;
metadata["duration"] = duration;
} else {
// asset can be null for files shared to app
if (asset != null) {
fileSubType = asset.subTypes;
metadata["subType"] = fileSubType;
if (fileType == FileType.video) {
duration = asset.duration;
metadata["duration"] = duration;
}
}
if (fileType == FileType.image || fileType == FileType.livePhoto){
exif = (await readExifFromFile(sourceFile)).toString();
metadata["exif"] = exif;
}