Przeglądaj źródła

Speed up memories (#1661)

Ashil 1 rok temu
rodzic
commit
fe5cba5b74

+ 21 - 0
ios/Podfile.lock

@@ -181,6 +181,21 @@ PODS:
   - sqflite (0.0.3):
   - sqflite (0.0.3):
     - Flutter
     - Flutter
     - FMDB (>= 2.7.5)
     - FMDB (>= 2.7.5)
+  - sqlite3 (3.45.0):
+    - sqlite3/common (= 3.45.0)
+  - sqlite3/common (3.45.0)
+  - sqlite3/fts5 (3.45.0):
+    - sqlite3/common
+  - sqlite3/perf-threadsafe (3.45.0):
+    - sqlite3/common
+  - sqlite3/rtree (3.45.0):
+    - sqlite3/common
+  - sqlite3_flutter_libs (0.0.1):
+    - Flutter
+    - sqlite3 (~> 3.45.0)
+    - sqlite3/fts5
+    - sqlite3/perf-threadsafe
+    - sqlite3/rtree
   - Toast (4.0.0)
   - Toast (4.0.0)
   - uni_links (0.0.1):
   - uni_links (0.0.1):
     - Flutter
     - Flutter
@@ -235,6 +250,7 @@ DEPENDENCIES:
   - share_plus (from `.symlinks/plugins/share_plus/ios`)
   - share_plus (from `.symlinks/plugins/share_plus/ios`)
   - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
   - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
   - sqflite (from `.symlinks/plugins/sqflite/ios`)
   - sqflite (from `.symlinks/plugins/sqflite/ios`)
+  - sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/ios`)
   - uni_links (from `.symlinks/plugins/uni_links/ios`)
   - uni_links (from `.symlinks/plugins/uni_links/ios`)
   - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
   - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
   - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
   - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
@@ -264,6 +280,7 @@ SPEC REPOS:
     - SDWebImageWebPCoder
     - SDWebImageWebPCoder
     - Sentry
     - Sentry
     - SentryPrivate
     - SentryPrivate
+    - sqlite3
     - Toast
     - Toast
 
 
 EXTERNAL SOURCES:
 EXTERNAL SOURCES:
@@ -343,6 +360,8 @@ EXTERNAL SOURCES:
     :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
     :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
   sqflite:
   sqflite:
     :path: ".symlinks/plugins/sqflite/ios"
     :path: ".symlinks/plugins/sqflite/ios"
+  sqlite3_flutter_libs:
+    :path: ".symlinks/plugins/sqlite3_flutter_libs/ios"
   uni_links:
   uni_links:
     :path: ".symlinks/plugins/uni_links/ios"
     :path: ".symlinks/plugins/uni_links/ios"
   url_launcher_ios:
   url_launcher_ios:
@@ -415,6 +434,8 @@ SPEC CHECKSUMS:
   share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
   share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
   shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c
   shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c
   sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
   sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
+  sqlite3: f307b6291c4db7b5086c38d6237446b98a738581
+  sqlite3_flutter_libs: aeb4d37509853dfa79d9b59386a2dac5dd079428
   Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
   Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
   uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
   uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
   url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
   url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4

+ 4 - 0
ios/Runner.xcodeproj/project.pbxproj

@@ -311,6 +311,8 @@
 				"${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework",
 				"${BUILT_PRODUCTS_DIR}/share_plus/share_plus.framework",
 				"${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework",
 				"${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework",
 				"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
 				"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
+				"${BUILT_PRODUCTS_DIR}/sqlite3/sqlite3.framework",
+				"${BUILT_PRODUCTS_DIR}/sqlite3_flutter_libs/sqlite3_flutter_libs.framework",
 				"${BUILT_PRODUCTS_DIR}/uni_links/uni_links.framework",
 				"${BUILT_PRODUCTS_DIR}/uni_links/uni_links.framework",
 				"${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework",
 				"${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework",
 				"${BUILT_PRODUCTS_DIR}/video_player_avfoundation/video_player_avfoundation.framework",
 				"${BUILT_PRODUCTS_DIR}/video_player_avfoundation/video_player_avfoundation.framework",
@@ -390,6 +392,8 @@
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_plus.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share_plus.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqlite3.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqlite3_flutter_libs.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/uni_links.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/uni_links.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player_avfoundation.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player_avfoundation.framework",

+ 49 - 0
lib/db/files_db.dart

@@ -15,6 +15,7 @@ import "package:photos/services/filter/db_filters.dart";
 import 'package:photos/utils/file_uploader_util.dart';
 import 'package:photos/utils/file_uploader_util.dart';
 import 'package:sqflite/sqflite.dart';
 import 'package:sqflite/sqflite.dart';
 import 'package:sqflite_migration/sqflite_migration.dart';
 import 'package:sqflite_migration/sqflite_migration.dart';
+import 'package:sqlite3/sqlite3.dart' as sqlite3;
 
 
 class FilesDB {
 class FilesDB {
   /*
   /*
@@ -100,6 +101,7 @@ class FilesDB {
 
 
   // only have a single app-wide reference to the database
   // only have a single app-wide reference to the database
   static Future<Database>? _dbFuture;
   static Future<Database>? _dbFuture;
+  static Future<sqlite3.Database>? _ffiDBFuture;
 
 
   Future<Database> get database async {
   Future<Database> get database async {
     // lazily instantiate the db the first time it is accessed
     // lazily instantiate the db the first time it is accessed
@@ -107,6 +109,11 @@ class FilesDB {
     return _dbFuture!;
     return _dbFuture!;
   }
   }
 
 
+  Future<sqlite3.Database> get ffiDB async {
+    _ffiDBFuture ??= _initFFIDatabase();
+    return _ffiDBFuture!;
+  }
+
   // this opens the database (and creates it if it doesn't exist)
   // this opens the database (and creates it if it doesn't exist)
   Future<Database> _initDatabase() async {
   Future<Database> _initDatabase() async {
     final Directory documentsDirectory =
     final Directory documentsDirectory =
@@ -116,6 +123,14 @@ class FilesDB {
     return await openDatabaseWithMigration(path, dbConfig);
     return await openDatabaseWithMigration(path, dbConfig);
   }
   }
 
 
+  Future<sqlite3.Database> _initFFIDatabase() async {
+    final Directory documentsDirectory =
+        await getApplicationDocumentsDirectory();
+    final String path = join(documentsDirectory.path, _databaseName);
+    _logger.info("DB path " + path);
+    return sqlite3.sqlite3.open(path);
+  }
+
   // SQL code to create the database table
   // SQL code to create the database table
   static List<String> createTable(String tableName) {
   static List<String> createTable(String tableName) {
     return [
     return [
@@ -749,6 +764,40 @@ class FilesDB {
     );
     );
   }
   }
 
 
+  Future<List<EnteFile>> getFilesCreatedWithinDurationsSync(
+    List<List<int>> durations,
+    Set<int> ignoredCollectionIDs, {
+    int? visibility,
+    String order = 'ASC',
+  }) async {
+    if (durations.isEmpty) {
+      return <EnteFile>[];
+    }
+    final db = await instance.ffiDB;
+    String whereClause = "( ";
+    for (int index = 0; index < durations.length; index++) {
+      whereClause += "($columnCreationTime >= " +
+          durations[index][0].toString() +
+          " AND $columnCreationTime < " +
+          durations[index][1].toString() +
+          ")";
+      if (index != durations.length - 1) {
+        whereClause += " OR ";
+      } else if (visibility != null) {
+        whereClause += ' AND $columnMMdVisibility = $visibility';
+      }
+    }
+    whereClause += ")";
+    final results = db.select(
+      'select * from $filesTable where $whereClause order by $columnCreationTime $order',
+    );
+    final files = convertToFiles(results);
+    return applyDBFilters(
+      files,
+      DBFilterOptions(ignoredCollectionIDs: ignoredCollectionIDs),
+    );
+  }
+
   // Files which user added to a collection manually but they are not
   // Files which user added to a collection manually but they are not
   // uploaded yet or files belonging to a collection which is marked for backup
   // uploaded yet or files belonging to a collection which is marked for backup
   Future<List<EnteFile>> getFilesPendingForUpload() async {
   Future<List<EnteFile>> getFilesPendingForUpload() async {

+ 0 - 1
lib/generated/intl/messages_cs.dart

@@ -34,7 +34,6 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage(
             MessageLookupByLibrary.simpleMessage(
                 "Edits to location will only be seen within Ente"),
                 "Edits to location will only be seen within Ente"),
         "fileTypes": MessageLookupByLibrary.simpleMessage("File types"),
         "fileTypes": MessageLookupByLibrary.simpleMessage("File types"),
-        "memories": MessageLookupByLibrary.simpleMessage("Memories"),
         "modifyYourQueryOrTrySearchingFor":
         "modifyYourQueryOrTrySearchingFor":
             MessageLookupByLibrary.simpleMessage(
             MessageLookupByLibrary.simpleMessage(
                 "Modify your query, or try searching for"),
                 "Modify your query, or try searching for"),

+ 0 - 1
lib/generated/intl/messages_de.dart

@@ -898,7 +898,6 @@ class MessageLookup extends MessageLookupByLibrary {
         "maps": MessageLookupByLibrary.simpleMessage("Karten"),
         "maps": MessageLookupByLibrary.simpleMessage("Karten"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
-        "memories": MessageLookupByLibrary.simpleMessage("Memories"),
         "memoryCount": m31,
         "memoryCount": m31,
         "merchandise": MessageLookupByLibrary.simpleMessage("Merchandise"),
         "merchandise": MessageLookupByLibrary.simpleMessage("Merchandise"),
         "mobileWebDesktop":
         "mobileWebDesktop":

+ 0 - 1
lib/generated/intl/messages_en.dart

@@ -871,7 +871,6 @@ class MessageLookup extends MessageLookupByLibrary {
         "maps": MessageLookupByLibrary.simpleMessage("Maps"),
         "maps": MessageLookupByLibrary.simpleMessage("Maps"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
-        "memories": MessageLookupByLibrary.simpleMessage("Memories"),
         "memoryCount": m31,
         "memoryCount": m31,
         "merchandise": MessageLookupByLibrary.simpleMessage("Merchandise"),
         "merchandise": MessageLookupByLibrary.simpleMessage("Merchandise"),
         "mobileWebDesktop":
         "mobileWebDesktop":

+ 0 - 1
lib/generated/intl/messages_es.dart

@@ -790,7 +790,6 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Administrar tu suscripción"),
             MessageLookupByLibrary.simpleMessage("Administrar tu suscripción"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
-        "memories": MessageLookupByLibrary.simpleMessage("Memories"),
         "memoryCount": m31,
         "memoryCount": m31,
         "merchandise": MessageLookupByLibrary.simpleMessage("Mercancías"),
         "merchandise": MessageLookupByLibrary.simpleMessage("Mercancías"),
         "mobileWebDesktop":
         "mobileWebDesktop":

+ 0 - 1
lib/generated/intl/messages_fr.dart

@@ -898,7 +898,6 @@ class MessageLookup extends MessageLookupByLibrary {
         "maps": MessageLookupByLibrary.simpleMessage("Cartes"),
         "maps": MessageLookupByLibrary.simpleMessage("Cartes"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
-        "memories": MessageLookupByLibrary.simpleMessage("Memories"),
         "memoryCount": m31,
         "memoryCount": m31,
         "merchandise": MessageLookupByLibrary.simpleMessage("Marchandise"),
         "merchandise": MessageLookupByLibrary.simpleMessage("Marchandise"),
         "mobileWebDesktop":
         "mobileWebDesktop":

+ 0 - 1
lib/generated/intl/messages_it.dart

@@ -867,7 +867,6 @@ class MessageLookup extends MessageLookupByLibrary {
         "maps": MessageLookupByLibrary.simpleMessage("Mappe"),
         "maps": MessageLookupByLibrary.simpleMessage("Mappe"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
-        "memories": MessageLookupByLibrary.simpleMessage("Memories"),
         "memoryCount": m31,
         "memoryCount": m31,
         "merchandise": MessageLookupByLibrary.simpleMessage("Merchandise"),
         "merchandise": MessageLookupByLibrary.simpleMessage("Merchandise"),
         "mobileWebDesktop":
         "mobileWebDesktop":

+ 0 - 1
lib/generated/intl/messages_ko.dart

@@ -34,7 +34,6 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage(
             MessageLookupByLibrary.simpleMessage(
                 "Edits to location will only be seen within Ente"),
                 "Edits to location will only be seen within Ente"),
         "fileTypes": MessageLookupByLibrary.simpleMessage("File types"),
         "fileTypes": MessageLookupByLibrary.simpleMessage("File types"),
-        "memories": MessageLookupByLibrary.simpleMessage("Memories"),
         "modifyYourQueryOrTrySearchingFor":
         "modifyYourQueryOrTrySearchingFor":
             MessageLookupByLibrary.simpleMessage(
             MessageLookupByLibrary.simpleMessage(
                 "Modify your query, or try searching for"),
                 "Modify your query, or try searching for"),

+ 0 - 1
lib/generated/intl/messages_nl.dart

@@ -889,7 +889,6 @@ class MessageLookup extends MessageLookupByLibrary {
         "maps": MessageLookupByLibrary.simpleMessage("Kaarten"),
         "maps": MessageLookupByLibrary.simpleMessage("Kaarten"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
-        "memories": MessageLookupByLibrary.simpleMessage("Memories"),
         "memoryCount": m31,
         "memoryCount": m31,
         "merchandise": MessageLookupByLibrary.simpleMessage("Merchandise"),
         "merchandise": MessageLookupByLibrary.simpleMessage("Merchandise"),
         "mobileWebDesktop":
         "mobileWebDesktop":

+ 0 - 1
lib/generated/intl/messages_no.dart

@@ -56,7 +56,6 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Ugyldig e-postadresse"),
             MessageLookupByLibrary.simpleMessage("Ugyldig e-postadresse"),
         "kindlyHelpUsWithThisInformation": MessageLookupByLibrary.simpleMessage(
         "kindlyHelpUsWithThisInformation": MessageLookupByLibrary.simpleMessage(
             "Vær vennlig og hjelp oss med denne informasjonen"),
             "Vær vennlig og hjelp oss med denne informasjonen"),
-        "memories": MessageLookupByLibrary.simpleMessage("Memories"),
         "modifyYourQueryOrTrySearchingFor":
         "modifyYourQueryOrTrySearchingFor":
             MessageLookupByLibrary.simpleMessage(
             MessageLookupByLibrary.simpleMessage(
                 "Modify your query, or try searching for"),
                 "Modify your query, or try searching for"),

+ 0 - 1
lib/generated/intl/messages_pl.dart

@@ -116,7 +116,6 @@ class MessageLookup extends MessageLookupByLibrary {
         "kindlyHelpUsWithThisInformation":
         "kindlyHelpUsWithThisInformation":
             MessageLookupByLibrary.simpleMessage("Pomóż nam z tą informacją"),
             MessageLookupByLibrary.simpleMessage("Pomóż nam z tą informacją"),
         "logInLabel": MessageLookupByLibrary.simpleMessage("Zaloguj się"),
         "logInLabel": MessageLookupByLibrary.simpleMessage("Zaloguj się"),
-        "memories": MessageLookupByLibrary.simpleMessage("Memories"),
         "moderateStrength": MessageLookupByLibrary.simpleMessage("Umiarkowana"),
         "moderateStrength": MessageLookupByLibrary.simpleMessage("Umiarkowana"),
         "modifyYourQueryOrTrySearchingFor":
         "modifyYourQueryOrTrySearchingFor":
             MessageLookupByLibrary.simpleMessage(
             MessageLookupByLibrary.simpleMessage(

+ 0 - 1
lib/generated/intl/messages_pt.dart

@@ -266,7 +266,6 @@ class MessageLookup extends MessageLookupByLibrary {
         "lostDevice":
         "lostDevice":
             MessageLookupByLibrary.simpleMessage("Dispositivo perdido?"),
             MessageLookupByLibrary.simpleMessage("Dispositivo perdido?"),
         "manage": MessageLookupByLibrary.simpleMessage("Gerenciar"),
         "manage": MessageLookupByLibrary.simpleMessage("Gerenciar"),
-        "memories": MessageLookupByLibrary.simpleMessage("Memories"),
         "moderateStrength": MessageLookupByLibrary.simpleMessage("Moderada"),
         "moderateStrength": MessageLookupByLibrary.simpleMessage("Moderada"),
         "modifyYourQueryOrTrySearchingFor":
         "modifyYourQueryOrTrySearchingFor":
             MessageLookupByLibrary.simpleMessage(
             MessageLookupByLibrary.simpleMessage(

+ 1 - 1
lib/generated/intl/messages_zh.dart

@@ -738,7 +738,6 @@ class MessageLookup extends MessageLookupByLibrary {
         "maps": MessageLookupByLibrary.simpleMessage("地图"),
         "maps": MessageLookupByLibrary.simpleMessage("地图"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
         "matrix": MessageLookupByLibrary.simpleMessage("Matrix"),
-        "memories": MessageLookupByLibrary.simpleMessage("Memories"),
         "memoryCount": m31,
         "memoryCount": m31,
         "merchandise": MessageLookupByLibrary.simpleMessage("商品"),
         "merchandise": MessageLookupByLibrary.simpleMessage("商品"),
         "mobileWebDesktop":
         "mobileWebDesktop":
@@ -1217,6 +1216,7 @@ class MessageLookup extends MessageLookupByLibrary {
         "viewer": MessageLookupByLibrary.simpleMessage("查看者"),
         "viewer": MessageLookupByLibrary.simpleMessage("查看者"),
         "visitWebToManage":
         "visitWebToManage":
             MessageLookupByLibrary.simpleMessage("请访问 web.ente.io 来管理您的订阅"),
             MessageLookupByLibrary.simpleMessage("请访问 web.ente.io 来管理您的订阅"),
+        "waitingForWifi": MessageLookupByLibrary.simpleMessage("正在等待 WiFi..."),
         "weAreOpenSource": MessageLookupByLibrary.simpleMessage("我们是开源的 !"),
         "weAreOpenSource": MessageLookupByLibrary.simpleMessage("我们是开源的 !"),
         "weDontSupportEditingPhotosAndAlbumsThatYouDont":
         "weDontSupportEditingPhotosAndAlbumsThatYouDont":
             MessageLookupByLibrary.simpleMessage("我们不支持编辑您尚未拥有的照片和相册"),
             MessageLookupByLibrary.simpleMessage("我们不支持编辑您尚未拥有的照片和相册"),

+ 1 - 1
lib/services/memories_service.dart

@@ -107,7 +107,7 @@ class MemoriesService extends ChangeNotifier {
     }
     }
     final ignoredCollections =
     final ignoredCollections =
         CollectionsService.instance.archivedOrHiddenCollectionIds();
         CollectionsService.instance.archivedOrHiddenCollectionIds();
-    final files = await _filesDB.getFilesCreatedWithinDurations(
+    final files = await _filesDB.getFilesCreatedWithinDurationsSync(
       durations,
       durations,
       ignoredCollections,
       ignoredCollections,
       visibility: visibleVisibility,
       visibility: visibleVisibility,

+ 18 - 2
pubspec.lock

@@ -1931,10 +1931,10 @@ packages:
     dependency: transitive
     dependency: transitive
     description:
     description:
       name: sqflite_common
       name: sqflite_common
-      sha256: "8ed044102f3135add97be8653662052838859f5400075ef227f8ad72ae320803"
+      sha256: bb4738f15b23352822f4c42a531677e5c6f522e079461fd240ead29d8d8a54a6
       url: "https://pub.dev"
       url: "https://pub.dev"
     source: hosted
     source: hosted
-    version: "2.5.0+1"
+    version: "2.5.0+2"
   sqflite_migration:
   sqflite_migration:
     dependency: "direct main"
     dependency: "direct main"
     description:
     description:
@@ -1943,6 +1943,22 @@ packages:
       url: "https://pub.dev"
       url: "https://pub.dev"
     source: hosted
     source: hosted
     version: "0.3.0"
     version: "0.3.0"
+  sqlite3:
+    dependency: "direct main"
+    description:
+      name: sqlite3
+      sha256: db65233e6b99e99b2548932f55a987961bc06d82a31a0665451fa0b4fff4c3fb
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.1.0"
+  sqlite3_flutter_libs:
+    dependency: "direct main"
+    description:
+      name: sqlite3_flutter_libs
+      sha256: "90963b515721d6a71e96f438175cf43c979493ed14822860a300b69694c74eb6"
+      url: "https://pub.dev"
+    source: hosted
+    version: "0.5.19+1"
   stack_trace:
   stack_trace:
     dependency: transitive
     dependency: transitive
     description:
     description:

+ 3 - 1
pubspec.yaml

@@ -12,7 +12,7 @@ description: ente photos application
 # Read more about iOS versioning at
 # Read more about iOS versioning at
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
 
 
-version: 0.8.38+558
+version: 0.8.42+562
 
 
 environment:
 environment:
   sdk: ">=3.0.0 <4.0.0"
   sdk: ">=3.0.0 <4.0.0"
@@ -140,6 +140,8 @@ dependencies:
   shared_preferences: ^2.0.5
   shared_preferences: ^2.0.5
   sqflite: ^2.3.0
   sqflite: ^2.3.0
   sqflite_migration: ^0.3.0
   sqflite_migration: ^0.3.0
+  sqlite3: ^2.1.0
+  sqlite3_flutter_libs: ^0.5.19+1
   step_progress_indicator: ^1.0.2
   step_progress_indicator: ^1.0.2
   styled_text: ^7.0.0
   styled_text: ^7.0.0
   syncfusion_flutter_core: ^19.2.49
   syncfusion_flutter_core: ^19.2.49

+ 1 - 0
thirdparty/isar

@@ -0,0 +1 @@
+Subproject commit 6643d064abf22606b6c6a741ea873e4781115ef4