Fire event to remove stale entries

This commit is contained in:
Neeraj Gupta 2022-09-02 13:53:49 +05:30
parent 3baafc72fb
commit 39affe4004
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -523,6 +523,13 @@ class FileUploader {
);
// should delete the fileToUploadEntry
await FilesDB.instance.deleteByGeneratedID(fileToUpload.generatedID);
Bus.instance.fire(
LocalPhotosUpdatedEvent(
[fileToUpload],
type: EventType.deletedFromEverywhere, //
),
);
return Tuple2(true, sameLocalSameCollection);
}
@ -546,6 +553,12 @@ class FileUploader {
fileToUpload.localID,
);
await FilesDB.instance.deleteByGeneratedID(fileToUpload.generatedID);
Bus.instance.fire(
LocalPhotosUpdatedEvent(
[fileToUpload],
type: EventType.deletedFromEverywhere, //
),
);
return Tuple2(true, fileMissingLocalButSameCollection);
}
@ -574,8 +587,10 @@ class FileUploader {
)
.map((e) => e.localID)
.toSet();
_logger.fine("Found hashMatch but probably with diff localIDs "
"$matchLocalIDs");
_logger.fine(
"Found hashMatch but probably with diff localIDs "
"$matchLocalIDs",
);
// case e
return Tuple2(false, fileToUpload);
}