mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
refactor(mobile): reworked Asset, store all required fields from local & remote (#1539)
replace usage of AssetResponseDto with Asset Add new class ExifInfo to store data from ExifResponseDto
This commit is contained in:
parent
7bd2455175
commit
0048662182
28 changed files with 626 additions and 504 deletions
|
|
@ -1,17 +1,18 @@
|
|||
import 'package:hive/hive.dart';
|
||||
import 'package:immich_mobile/shared/models/asset.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
import '../constants/hive_box.dart';
|
||||
|
||||
String getThumbnailUrl(
|
||||
final AssetResponseDto asset, {
|
||||
final Asset asset, {
|
||||
ThumbnailFormat type = ThumbnailFormat.WEBP,
|
||||
}) {
|
||||
return _getThumbnailUrl(asset.id, type: type);
|
||||
return _getThumbnailUrl(asset.remoteId!, type: type);
|
||||
}
|
||||
|
||||
String getThumbnailCacheKey(
|
||||
final AssetResponseDto asset, {
|
||||
final Asset asset, {
|
||||
ThumbnailFormat type = ThumbnailFormat.WEBP,
|
||||
}) {
|
||||
return _getThumbnailCacheKey(asset.id, type);
|
||||
|
|
@ -45,12 +46,12 @@ String getAlbumThumbNailCacheKey(
|
|||
return _getThumbnailCacheKey(album.albumThumbnailAssetId!, type);
|
||||
}
|
||||
|
||||
String getImageUrl(final AssetResponseDto asset) {
|
||||
String getImageUrl(final Asset asset) {
|
||||
final box = Hive.box(userInfoBox);
|
||||
return '${box.get(serverEndpointKey)}/asset/file/${asset.id}?isThumb=false';
|
||||
return '${box.get(serverEndpointKey)}/asset/file/${asset.remoteId}?isThumb=false';
|
||||
}
|
||||
|
||||
String getImageCacheKey(final AssetResponseDto asset) {
|
||||
String getImageCacheKey(final Asset asset) {
|
||||
return '${asset.id}_fullStage';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue