Skip to content

Commit

Permalink
refactor(server): download file (#1512)
Browse files Browse the repository at this point in the history
* refactor(server): download file

* chore: generate open-api and remove unused refs

* chore(server): tests

* chore: remove unused code
  • Loading branch information
jrasm91 committed Feb 3, 2023
1 parent e395075 commit 2b0b2bb
Show file tree
Hide file tree
Showing 29 changed files with 210 additions and 291 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@ class ImageViewerService {
if (asset.type == AssetTypeEnum.IMAGE && asset.livePhotoVideoId != null) {
var imageResponse = await _apiService.assetApi.downloadFileWithHttpInfo(
asset.id,
isThumb: false,
isWeb: false,
);

var motionReponse = await _apiService.assetApi.downloadFileWithHttpInfo(
asset.livePhotoVideoId!,
isThumb: false,
isWeb: false,
);

final AssetEntity? entity;
Expand All @@ -54,8 +50,6 @@ class ImageViewerService {
} else {
var res = await _apiService.assetApi.downloadFileWithHttpInfo(
asset.id,
isThumb: false,
isWeb: false,
);

final AssetEntity? entity;
Expand Down
2 changes: 0 additions & 2 deletions mobile/lib/shared/services/share.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class ShareService {
final tempFile = await File('${tempDir.path}/$fileName').create();
final res = await _apiService.assetApi.downloadFileWithHttpInfo(
asset.remote!.id,
isThumb: false,
isWeb: false,
);
tempFile.writeAsBytesSync(res.bodyBytes);
return XFile(tempFile.path);
Expand Down
2 changes: 1 addition & 1 deletion mobile/openapi/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions mobile/openapi/doc/AssetApi.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 3 additions & 18 deletions mobile/openapi/lib/api/asset_api.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 41 additions & 53 deletions mobile/openapi/lib/model/album_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit 2b0b2bb

@vercel
Copy link

@vercel vercel bot commented on 2b0b2bb Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.