mirror of
https://github.com/immich-app/immich.git
synced 2024-12-19 00:32:49 +02:00
cb391342d7
* feat(mobile): map page - add map view * map: add map-markers * feat(map): add relative date filter * fix: do not let users scroll past map bounds * fix: fetch relative date from store to state on init * feat(mobile):re-fetch markers only on filter change * feat(mobile) - asset bottom sheet in map page * feat(mobile): display markers based on bottom sheet scroll * fix: exif-bottom-sheet - rebase conflict * feat(mobile): map-view - strongly typed map page events * feat(map): zoom to asset * chore: dart analyzer fixes * map-page move attribution to top-right * feat(mobile): map view - asset selection handling * feat(mobile): map-view display map in places row * fix: make asset marker icon responsive * optimise map page rebuilds * refactor(mobile): map page * feat(mobile): map-view: Go to location * map-view(mobile): minor refactor * fix(mobile): Handle invalid coords gracefully * small styling --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
73 lines
1.8 KiB
Dart
73 lines
1.8 KiB
Dart
import 'package:immich_mobile/shared/models/album.dart';
|
|
import 'package:immich_mobile/shared/models/asset.dart';
|
|
import 'package:immich_mobile/shared/models/store.dart';
|
|
import 'package:openapi/api.dart';
|
|
|
|
String getThumbnailUrl(
|
|
final Asset asset, {
|
|
ThumbnailFormat type = ThumbnailFormat.WEBP,
|
|
}) {
|
|
return getThumbnailUrlForRemoteId(asset.remoteId!, type: type);
|
|
}
|
|
|
|
String getThumbnailCacheKey(
|
|
final Asset asset, {
|
|
ThumbnailFormat type = ThumbnailFormat.WEBP,
|
|
}) {
|
|
return getThumbnailCacheKeyForRemoteId(asset.remoteId!, type: type);
|
|
}
|
|
|
|
String getThumbnailCacheKeyForRemoteId(
|
|
final String id, {
|
|
ThumbnailFormat type = ThumbnailFormat.WEBP,
|
|
}) {
|
|
if (type == ThumbnailFormat.WEBP) {
|
|
return 'thumbnail-image-$id';
|
|
} else {
|
|
return '${id}_previewStage';
|
|
}
|
|
}
|
|
|
|
String getAlbumThumbnailUrl(
|
|
final Album album, {
|
|
ThumbnailFormat type = ThumbnailFormat.WEBP,
|
|
}) {
|
|
if (album.thumbnail.value?.remoteId == null) {
|
|
return '';
|
|
}
|
|
return getThumbnailUrlForRemoteId(album.thumbnail.value!.remoteId!,
|
|
type: type,);
|
|
}
|
|
|
|
String getAlbumThumbNailCacheKey(
|
|
final Album album, {
|
|
ThumbnailFormat type = ThumbnailFormat.WEBP,
|
|
}) {
|
|
if (album.thumbnail.value?.remoteId == null) {
|
|
return '';
|
|
}
|
|
return getThumbnailCacheKeyForRemoteId(
|
|
album.thumbnail.value!.remoteId!,
|
|
type: type,
|
|
);
|
|
}
|
|
|
|
String getImageUrl(final Asset asset) {
|
|
return '${Store.get(StoreKey.serverEndpoint)}/asset/file/${asset.remoteId}?isThumb=false';
|
|
}
|
|
|
|
String getImageCacheKey(final Asset asset) {
|
|
return '${asset.id}_fullStage';
|
|
}
|
|
|
|
String getThumbnailUrlForRemoteId(
|
|
final String id, {
|
|
ThumbnailFormat type = ThumbnailFormat.WEBP,
|
|
}) {
|
|
return '${Store.get(StoreKey.serverEndpoint)}/asset/thumbnail/$id?format=${type.value}';
|
|
}
|
|
|
|
String getFaceThumbnailUrl(final String personId) {
|
|
return '${Store.get(StoreKey.serverEndpoint)}/person/$personId/thumbnail';
|
|
}
|