Upload videos along with photos
This commit is contained in:
@@ -571,7 +571,7 @@ class RemoteSyncService {
|
||||
_logger.info("Skipped $skippedVideos videos and $ignoredForUpload "
|
||||
"ignored files for upload");
|
||||
}
|
||||
_sortByTimeAndType(filesToBeUploaded);
|
||||
_sortByTime(filesToBeUploaded);
|
||||
_logger.info("${filesToBeUploaded.length} new files to be uploaded.");
|
||||
return filesToBeUploaded;
|
||||
}
|
||||
@@ -932,17 +932,11 @@ class RemoteSyncService {
|
||||
return Platform.isIOS && !AppLifecycleService.instance.isForeground;
|
||||
}
|
||||
|
||||
// _sortByTimeAndType moves videos to end and sort by creation time (desc).
|
||||
// _sortByTime sort by creation time (desc).
|
||||
// This is done to upload most recent photo first.
|
||||
void _sortByTimeAndType(List<EnteFile> file) {
|
||||
void _sortByTime(List<EnteFile> file) {
|
||||
file.sort((first, second) {
|
||||
if (first.fileType == second.fileType) {
|
||||
return second.creationTime!.compareTo(first.creationTime!);
|
||||
} else if (first.fileType == FileType.video) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
return second.creationTime!.compareTo(first.creationTime!);
|
||||
});
|
||||
// move updated files towards the end
|
||||
file.sort((first, second) {
|
||||
|
||||
Reference in New Issue
Block a user