mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(mobile): reworked Asset, store all required fields from local & remote (#1539)
replace usage of AssetResponseDto with Asset Add new class ExifInfo to store data from ExifResponseDto
This commit is contained in:
parent
7bd2455175
commit
0048662182
28 changed files with 626 additions and 504 deletions
|
|
@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/shared/models/asset.dart';
|
||||
import 'package:immich_mobile/shared/providers/api.provider.dart';
|
||||
import 'package:path/path.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'api.service.dart';
|
||||
|
|
@ -25,11 +24,10 @@ class ShareService {
|
|||
final downloadedXFiles = assets.map<Future<XFile>>((asset) async {
|
||||
if (asset.isRemote) {
|
||||
final tempDir = await getTemporaryDirectory();
|
||||
final fileName = basename(asset.remote!.originalPath);
|
||||
final fileName = asset.fileName;
|
||||
final tempFile = await File('${tempDir.path}/$fileName').create();
|
||||
final res = await _apiService.assetApi.downloadFileWithHttpInfo(
|
||||
asset.remote!.id,
|
||||
);
|
||||
final res = await _apiService.assetApi
|
||||
.downloadFileWithHttpInfo(asset.remoteId!);
|
||||
tempFile.writeAsBytesSync(res.bodyBytes);
|
||||
return XFile(tempFile.path);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue