Merge pull request #553 from ente-io/fix_sql

This commit is contained in:
Vishnu Mohandas 2022-10-07 08:31:58 +05:30 committed by Neeraj Gupta
parent 2979792451
commit ab9b5dc3c4
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
3 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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) {

View file

@ -70,12 +70,12 @@ Future<List<Tuple2<AssetPathEntity, String>>>
const OrderOption(type: OrderOptionType.createDate, asc: false),
);
for (AssetPathEntity pathEntity in pathEntities) {
//todo: test and handle empty album case
final latestEntity = await pathEntity.getAssetListPaged(
page: 0,
size: 1,
);
final String localCoverID = latestEntity.first.id;
final String localCoverID =
latestEntity.isEmpty ? '' : latestEntity.first.id;
result.add(Tuple2(pathEntity, localCoverID));
}
return result;