2023-03-27 04:35:52 +02:00
|
|
|
import 'package:immich_mobile/shared/models/album.dart';
|
|
|
|
import 'package:immich_mobile/shared/models/asset.dart';
|
2023-05-25 05:52:43 +02:00
|
|
|
import 'package:immich_mobile/shared/models/etag.dart';
|
2023-03-27 04:35:52 +02:00
|
|
|
import 'package:immich_mobile/shared/models/exif_info.dart';
|
|
|
|
import 'package:immich_mobile/shared/models/store.dart';
|
2023-05-25 05:52:43 +02:00
|
|
|
import 'package:immich_mobile/shared/models/user.dart';
|
2023-03-27 04:35:52 +02:00
|
|
|
import 'package:isar/isar.dart';
|
|
|
|
|
|
|
|
Future<void> clearAssetsAndAlbums(Isar db) async {
|
|
|
|
await Store.delete(StoreKey.assetETag);
|
|
|
|
await db.writeTxn(() async {
|
|
|
|
await db.assets.clear();
|
|
|
|
await db.exifInfos.clear();
|
|
|
|
await db.albums.clear();
|
2023-05-25 05:52:43 +02:00
|
|
|
await db.eTags.clear();
|
|
|
|
await db.users.clear();
|
2023-03-27 04:35:52 +02:00
|
|
|
});
|
|
|
|
}
|