mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04: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
@ -14,7 +14,7 @@ class AlbumMediaRepository {
|
||||
const AlbumMediaRepository();
|
||||
|
||||
bool get useCustomFilter =>
|
||||
Store.get(StoreKey.photoManagerCustomFilter, false);
|
||||
Store.get(StoreKey.photoManagerCustomFilter, true);
|
||||
|
||||
FilterOptionGroup? _getAlbumFilter({
|
||||
DateTimeCond? updateTimeCond,
|
||||
|
@ -88,7 +88,7 @@ enum AppSettingsEnum<T> {
|
||||
photoManagerCustomFilter<bool>(
|
||||
StoreKey.photoManagerCustomFilter,
|
||||
null,
|
||||
false,
|
||||
true,
|
||||
),
|
||||
;
|
||||
|
||||
|
@ -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…
x
Reference in New Issue
Block a user