mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-01-15 05:36:08 +00:00
chore(server) refactor serveFile and downloadFile endpoint (#978)
This commit is contained in:
@@ -23,8 +23,7 @@ class ImageViewerService {
|
||||
String fileName = p.basename(asset.originalPath);
|
||||
|
||||
var res = await _apiService.assetApi.downloadFileWithHttpInfo(
|
||||
asset.deviceAssetId,
|
||||
asset.deviceId,
|
||||
asset.id,
|
||||
isThumb: false,
|
||||
isWeb: false,
|
||||
);
|
||||
|
||||
@@ -42,7 +42,7 @@ class VideoViewerPage extends HookConsumerWidget {
|
||||
final box = Hive.box(userInfoBox);
|
||||
final String jwtToken = box.get(accessTokenKey);
|
||||
final String videoUrl =
|
||||
'${box.get(serverEndpointKey)}/asset/file?aid=${asset.deviceAssetId}&did=${asset.deviceId}';
|
||||
'${box.get(serverEndpointKey)}/asset/file/${asset.id}';
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
|
||||
@@ -28,8 +28,7 @@ class ShareService {
|
||||
final fileName = basename(asset.remote!.originalPath);
|
||||
final tempFile = await File('${tempDir.path}/$fileName').create();
|
||||
final res = await _apiService.assetApi.downloadFileWithHttpInfo(
|
||||
asset.remote!.deviceAssetId,
|
||||
asset.remote!.deviceId,
|
||||
asset.remote!.id,
|
||||
isThumb: false,
|
||||
isWeb: false,
|
||||
);
|
||||
|
||||
@@ -22,7 +22,7 @@ String getAlbumThumbnailUrl(
|
||||
|
||||
String getImageUrl(final AssetResponseDto asset) {
|
||||
final box = Hive.box(userInfoBox);
|
||||
return '${box.get(serverEndpointKey)}/asset/file?aid=${asset.deviceAssetId}&did=${asset.deviceId}&isThumb=false';
|
||||
return '${box.get(serverEndpointKey)}/asset/file/${asset.id}?isThumb=false';
|
||||
}
|
||||
|
||||
String _getThumbnailUrl(
|
||||
|
||||
Reference in New Issue
Block a user