Explorar o código

Fix: Fallback logic to fetch device album cover

Neeraj Gupta %!s(int64=2) %!d(string=hai) anos
pai
achega
162d1ab658
Modificáronse 2 ficheiros con 4 adicións e 3 borrados
  1. 1 1
      ios/Podfile.lock
  2. 3 2
      lib/db/device_files_db.dart

+ 1 - 1
ios/Podfile.lock

@@ -316,7 +316,7 @@ SPEC CHECKSUMS:
   FirebaseInstallations: 0a115432c4e223c5ab20b0dbbe4cbefa793a0e8e
   FirebaseMessaging: 732623518591384f61c287e3d8f65294beb7ffb3
   fk_user_agent: 1f47ec39291e8372b1d692b50084b0d54103c545
-  Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
+  Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
   flutter_email_sender: 02d7443217d8c41483223627972bfdc09f74276b
   flutter_image_compress: 5a5e9aee05b6553048b8df1c3bc456d0afaac433
   flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721

+ 3 - 2
lib/db/device_files_db.dart

@@ -356,7 +356,7 @@ extension DeviceFiles on FilesDB {
             (element) => element.localID == deviceCollection.coverId,
             orElse: () => null,
           );
-          if (deviceCollection.thumbnail == null) {
+          if (deviceCollection.thumbnail != null) {
             final File result =
                 await getDeviceCollectionThumbnail(deviceCollection.id);
             if (result == null) {
@@ -387,8 +387,9 @@ extension DeviceFiles on FilesDB {
     final db = await database;
     final fileRows = await db.rawQuery(
       '''SELECT * FROM FILES  f JOIN device_files df on f.local_id = df.id 
-      and df.path_id=$pathID order by f.modification_time DESC limit 1;
+      and df.path_id= ? order by f.modification_time DESC limit 1;
           ''',
+      [pathID],
     );
     final files = convertToFiles(fileRows);
     if (files.isNotEmpty) {