Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions mobile/lib/infrastructure/repositories/storage.repository.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:io';

import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
import 'package:immich_mobile/extensions/platform_extensions.dart';
import 'package:logging/logging.dart';
import 'package:photo_manager/photo_manager.dart';

Expand Down Expand Up @@ -89,5 +90,17 @@ class StorageRepository {
} catch (error, stackTrace) {
log.warning("Error clearing cache", error, stackTrace);
}

if (!CurrentPlatform.isIOS) {
return;
}

try {
if (await Directory.systemTemp.exists()) {
await Directory.systemTemp.delete(recursive: true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't a bit excessive to delete everything in system temp? That includes things unrelated to Immich, doesn't it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On iOS / macOS, the directory is actually internal to the App's sandbox even though the static accessor says systemTemp

}
} catch (error, stackTrace) {
log.warning("Error deleting temporary directory", error, stackTrace);
}
}
}
Loading