feat: full local assets / album sync
This commit is contained in:
@@ -1,28 +1,36 @@
|
||||
import 'package:immich_mobile/domain/models/asset.model.dart';
|
||||
import 'package:immich_mobile/service_locator.dart';
|
||||
import 'package:immich_mobile/utils/immich_api_client.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
enum AssetMediaSize {
|
||||
preview._('preview'),
|
||||
thumbnail._('thumbnail');
|
||||
|
||||
const AssetMediaSize._(this.value);
|
||||
|
||||
final String value;
|
||||
}
|
||||
|
||||
class ImImageUrlHelper {
|
||||
const ImImageUrlHelper();
|
||||
|
||||
static String get _serverUrl => di<ImmichApiClient>().basePath;
|
||||
static String get _serverUrl => di<ImApiClient>().basePath;
|
||||
|
||||
static String getThumbnailUrl(
|
||||
final Asset asset, {
|
||||
AssetMediaSize type = AssetMediaSize.thumbnail,
|
||||
}) {
|
||||
return _getThumbnailUrlForRemoteId(asset.remoteId!, type: type);
|
||||
return getThumbnailUrlForRemoteId(asset.remoteId!, type: type);
|
||||
}
|
||||
|
||||
static String getThumbnailCacheKey(
|
||||
final Asset asset, {
|
||||
AssetMediaSize type = AssetMediaSize.thumbnail,
|
||||
}) {
|
||||
return _getThumbnailCacheKeyForRemoteId(asset.remoteId!, type: type);
|
||||
return getThumbnailCacheKeyForRemoteId(asset.remoteId!, type: type);
|
||||
}
|
||||
|
||||
static String _getThumbnailCacheKeyForRemoteId(
|
||||
static String getThumbnailCacheKeyForRemoteId(
|
||||
final String id, {
|
||||
AssetMediaSize type = AssetMediaSize.thumbnail,
|
||||
}) {
|
||||
@@ -32,7 +40,7 @@ class ImImageUrlHelper {
|
||||
return 'preview-image-$id';
|
||||
}
|
||||
|
||||
static String _getThumbnailUrlForRemoteId(
|
||||
static String getThumbnailUrlForRemoteId(
|
||||
final String id, {
|
||||
AssetMediaSize type = AssetMediaSize.thumbnail,
|
||||
}) {
|
||||
|
||||
Reference in New Issue
Block a user