mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix: enable photo manager custom filter by default (#19520)
enable photo manager custom filter by default Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
fda22c83b9
commit
24a4cba953
3 changed files with 12 additions and 8 deletions
|
|
@ -23,7 +23,7 @@ import 'package:isar/isar.dart';
|
|||
// ignore: import_rule_photo_manager
|
||||
import 'package:photo_manager/photo_manager.dart';
|
||||
|
||||
const int targetVersion = 12;
|
||||
const int targetVersion = 13;
|
||||
|
||||
Future<void> migrateDatabaseIfNeeded(Isar db) async {
|
||||
final int version = Store.get(StoreKey.version, targetVersion);
|
||||
|
|
@ -56,14 +56,18 @@ Future<void> migrateDatabaseIfNeeded(Isar db) async {
|
|||
await drift.close();
|
||||
}
|
||||
|
||||
if (version < 13) {
|
||||
await Store.put(StoreKey.photoManagerCustomFilter, true);
|
||||
}
|
||||
|
||||
if (targetVersion >= 12) {
|
||||
await Store.put(StoreKey.version, targetVersion);
|
||||
return;
|
||||
}
|
||||
|
||||
final shouldTruncate = version < 8 || version < targetVersion;
|
||||
|
||||
if (shouldTruncate) {
|
||||
if (targetVersion == 12) {
|
||||
await Store.put(StoreKey.version, targetVersion);
|
||||
return;
|
||||
}
|
||||
|
||||
await _migrateTo(db, targetVersion);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue