1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00
Files
immich/mobile/lib/infrastructure/repositories/storage.repository.dart
shenlong dfe6d27bbd feat: sqlite video player (#19792)
* feat: video player

* use remote asset id in local query

* fix: error from pre-caching beyond total assets

* fix: flipped local videos

* incorrect aspect ratio on iOS

* ignore other storage id during equals check

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-07-09 09:34:25 -05:00

24 lines
623 B
Dart

import 'dart:io';
import 'package:logging/logging.dart';
import 'package:photo_manager/photo_manager.dart';
class StorageRepository {
const StorageRepository();
Future<File?> getFileForAsset(String assetId) async {
final log = Logger('StorageRepository');
File? file;
try {
final entity = await AssetEntity.fromId(assetId);
file = await entity?.originFile;
if (file == null) {
log.warning("Cannot get file for asset $assetId");
}
} catch (error, stackTrace) {
log.warning("Error getting file for asset $assetId", error, stackTrace);
}
return file;
}
}