|
@@ -88,20 +88,19 @@ class _LazyGroupGalleryState extends State<LazyGroupGallery> {
|
|
|
}
|
|
|
|
|
|
Future _onReload(FilesUpdatedEvent event) async {
|
|
|
- final groupDate =
|
|
|
+ final DateTime groupDate =
|
|
|
DateTime.fromMicrosecondsSinceEpoch(_files[0].creationTime!);
|
|
|
- // iterate over all files and check if any of the belongs to this group
|
|
|
- final updateFilesBelongingToGroup = event.updatedFiles.where((file) {
|
|
|
+ // iterate over files and check if any of the belongs to this group
|
|
|
+ final anyCandidateForGroup = event.updatedFiles.any((file) {
|
|
|
final fileDate = DateTime.fromMicrosecondsSinceEpoch(file.creationTime!);
|
|
|
return fileDate.year == groupDate.year &&
|
|
|
fileDate.month == groupDate.month &&
|
|
|
fileDate.day == groupDate.day;
|
|
|
});
|
|
|
- if (updateFilesBelongingToGroup.isNotEmpty) {
|
|
|
+ if (anyCandidateForGroup) {
|
|
|
if (kDebugMode) {
|
|
|
_logger.info(
|
|
|
- updateFilesBelongingToGroup.length.toString() +
|
|
|
- " files were updated due to ${event.reason} on " +
|
|
|
+ " files were updated due to ${event.reason} on " +
|
|
|
DateTime.fromMicrosecondsSinceEpoch(
|
|
|
groupDate.microsecondsSinceEpoch,
|
|
|
).toIso8601String(),
|