mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
Modify Album API endpoint to return a count attribute instead of a full assets array (#454)
* Change API to return assets count and change web behavior accordingly * Refactor assets.length * Explicitly declare type of assetCount so Dart SDK understand it * Finished refactoring on mobile
This commit is contained in:
parent
bd5ed1b684
commit
5c78f707fe
13 changed files with 107 additions and 91 deletions
|
|
@ -61,13 +61,13 @@ class AlbumThumbnailCard extends StatelessWidget {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
album.assets.length == 1
|
||||
album.assetCount == 1
|
||||
? 'album_thumbnail_card_item'
|
||||
: 'album_thumbnail_card_items',
|
||||
style: const TextStyle(
|
||||
fontSize: 10,
|
||||
),
|
||||
).tr(args: ['${album.assets.length }']),
|
||||
).tr(args: ['${album.assetCount}']),
|
||||
if (album.shared)
|
||||
const Text(
|
||||
'album_thumbnail_card_shared',
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ class AlbumViewerPage extends HookConsumerWidget {
|
|||
assetList: albumInfo.assets,
|
||||
);
|
||||
},
|
||||
childCount: albumInfo.assets.length,
|
||||
childCount: albumInfo.assetCount,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue