From 257b0c74af98fe2577ed3653dc9bb167a6effbd0 Mon Sep 17 00:00:00 2001 From: Aaron Tulino Date: Mon, 18 Aug 2025 16:02:18 -0700 Subject: [PATCH] fix(mobile): show most recent image in album as thumbnail (#21037) Show most recent image in album as thumbnail Fixes #21004 --- .../lib/infrastructure/repositories/local_album.repository.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/lib/infrastructure/repositories/local_album.repository.dart b/mobile/lib/infrastructure/repositories/local_album.repository.dart index 869d8f0dc8..db72dddc57 100644 --- a/mobile/lib/infrastructure/repositories/local_album.repository.dart +++ b/mobile/lib/infrastructure/repositories/local_album.repository.dart @@ -319,7 +319,7 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository { innerJoin(_db.localAssetEntity, _db.localAlbumAssetEntity.assetId.equalsExp(_db.localAssetEntity.id)), ]) ..where(_db.localAlbumAssetEntity.albumId.equals(albumId)) - ..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)]) + ..orderBy([OrderingTerm.desc(_db.localAssetEntity.createdAt)]) ..limit(1); final results = await query.map((row) => row.readTable(_db.localAssetEntity).toDto()).get();