Make album repo optional in remove

Useful when removing data files
This commit is contained in:
Ming Ming 2021-05-24 04:02:03 +08:00
parent b46a2704a3
commit be8a45751c

View file

@ -14,7 +14,10 @@ class Remove {
/// Remove a file
Future<void> call(Account account, File file) async {
await fileRepo.remove(account, file);
await _cleanUpAlbums(account, file);
if (albumRepo != null) {
_log.info("[call] Skip albums cleanup as albumRepo == null");
await _cleanUpAlbums(account, file);
}
KiwiContainer().resolve<EventBus>().fire(FileRemovedEvent(account, file));
}