mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore(mobile): use Record instead of custom pair+triple (#2483)
This commit is contained in:
parent
a089d9891d
commit
dc7b0f75bb
6 changed files with 58 additions and 80 deletions
|
|
@ -10,7 +10,6 @@ import 'package:immich_mobile/shared/providers/db.provider.dart';
|
|||
import 'package:immich_mobile/shared/services/api.service.dart';
|
||||
import 'package:immich_mobile/shared/services/sync.service.dart';
|
||||
import 'package:immich_mobile/utils/openapi_extensions.dart';
|
||||
import 'package:immich_mobile/utils/tuple.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
|
@ -60,15 +59,14 @@ class AssetService {
|
|||
}) async {
|
||||
try {
|
||||
final etag = hasCache ? Store.tryGet(StoreKey.assetETag) : null;
|
||||
final Pair<List<AssetResponseDto>, String?>? remote =
|
||||
final (List<AssetResponseDto>? assets, String? newETag) =
|
||||
await _apiService.assetApi.getAllAssetsWithETag(eTag: etag);
|
||||
if (remote == null) {
|
||||
if (assets == null) {
|
||||
return null;
|
||||
} else if (newETag != etag) {
|
||||
Store.put(StoreKey.assetETag, newETag);
|
||||
}
|
||||
if (remote.second != null && remote.second != etag) {
|
||||
Store.put(StoreKey.assetETag, remote.second);
|
||||
}
|
||||
return remote.first;
|
||||
return assets;
|
||||
} catch (e, stack) {
|
||||
log.severe('Error while getting remote assets', e, stack);
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue