Skip to content

Commit

Permalink
refactor(server): download endpoints (#6653)
Browse files Browse the repository at this point in the history
* refactor(server): download controller

* chore: open api

* chore: fix mobile references
  • Loading branch information
jrasm91 authored Jan 26, 2024
1 parent de47a6a commit 7ea55c7
Show file tree
Hide file tree
Showing 29 changed files with 1,420 additions and 388 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class ImageViewerService {
try {
// Download LivePhotos image and motion part
if (asset.isImage && asset.livePhotoVideoId != null && Platform.isIOS) {
var imageResponse = await _apiService.assetApi.downloadFileWithHttpInfo(
var imageResponse = await _apiService.assetApi.downloadFileOldWithHttpInfo(
asset.remoteId!,
);

var motionReponse = await _apiService.assetApi.downloadFileWithHttpInfo(
var motionReponse = await _apiService.assetApi.downloadFileOldWithHttpInfo(
asset.livePhotoVideoId!,
);

Expand Down Expand Up @@ -70,7 +70,7 @@ class ImageViewerService {
return entity != null;
} else {
var res = await _apiService.assetApi
.downloadFileWithHttpInfo(asset.remoteId!);
.downloadFileOldWithHttpInfo(asset.remoteId!);

if (res.statusCode != 200) {
_log.severe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class BackupVerificationService {
final Uint64List localImage =
_fakeDecodeImg(local, await file.readAsBytes());
final res = await apiService.assetApi
.downloadFileWithHttpInfo(remote.remoteId!);
.downloadFileOldWithHttpInfo(remote.remoteId!);
final Uint64List remoteImage = _fakeDecodeImg(remote, res.bodyBytes);

final eq = const ListEquality().equals(remoteImage, localImage);
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/shared/services/share.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ShareService {
final fileName = asset.fileName;
final tempFile = await File('${tempDir.path}/$fileName').create();
final res = await _apiService.assetApi
.downloadFileWithHttpInfo(asset.remoteId!);
.downloadFileOldWithHttpInfo(asset.remoteId!);

if (res.statusCode != 200) {
_log.severe(
Expand Down
3 changes: 3 additions & 0 deletions mobile/openapi/.openapi-generator/FILES

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

9 changes: 6 additions & 3 deletions mobile/openapi/README.md

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

30 changes: 15 additions & 15 deletions mobile/openapi/doc/AssetApi.md

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

187 changes: 187 additions & 0 deletions mobile/openapi/doc/DownloadApi.md

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

1 change: 1 addition & 0 deletions mobile/openapi/lib/api.dart

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

Loading

0 comments on commit 7ea55c7

Please sign in to comment.