mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 20:25:32 -04:00
refactor: using recommended api to get device albums
This commit is contained in:
parent
ae6653392e
commit
73ea1e8fb5
@ -30,7 +30,7 @@ class AlbumMediaRepository implements IAlbumMediaRepository {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getAssetIds(String albumId) async {
|
Future<List<String>> getAssetIds(String albumId) async {
|
||||||
final album = await AssetPathEntity.fromId(albumId);
|
final album = await AssetPathEntity.obtainPathFromProperties(id: albumId);
|
||||||
final List<AssetEntity> assets =
|
final List<AssetEntity> assets =
|
||||||
await album.getAssetListRange(start: 0, end: 0x7fffffffffffffff);
|
await album.getAssetListRange(start: 0, end: 0x7fffffffffffffff);
|
||||||
return assets.map((e) => e.id).toList();
|
return assets.map((e) => e.id).toList();
|
||||||
@ -38,7 +38,7 @@ class AlbumMediaRepository implements IAlbumMediaRepository {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<int> getAssetCount(String albumId) async {
|
Future<int> getAssetCount(String albumId) async {
|
||||||
final album = await AssetPathEntity.fromId(albumId);
|
final album = await AssetPathEntity.obtainPathFromProperties(id: albumId);
|
||||||
return album.assetCountAsync;
|
return album.assetCountAsync;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,9 +51,9 @@ class AlbumMediaRepository implements IAlbumMediaRepository {
|
|||||||
DateTime? modifiedUntil,
|
DateTime? modifiedUntil,
|
||||||
bool orderByModificationDate = false,
|
bool orderByModificationDate = false,
|
||||||
}) async {
|
}) async {
|
||||||
final onDevice = await AssetPathEntity.fromId(
|
final onDevice = await AssetPathEntity.obtainPathFromProperties(
|
||||||
albumId,
|
id: albumId,
|
||||||
filterOption: FilterOptionGroup(
|
optionGroup: FilterOptionGroup(
|
||||||
imageOption: const FilterOption(needTitle: true),
|
imageOption: const FilterOption(needTitle: true),
|
||||||
videoOption: const FilterOption(needTitle: true),
|
videoOption: const FilterOption(needTitle: true),
|
||||||
containsPathModified: true,
|
containsPathModified: true,
|
||||||
@ -80,7 +80,8 @@ class AlbumMediaRepository implements IAlbumMediaRepository {
|
|||||||
DateTime? modifiedFrom,
|
DateTime? modifiedFrom,
|
||||||
DateTime? modifiedUntil,
|
DateTime? modifiedUntil,
|
||||||
}) async {
|
}) async {
|
||||||
final assetPathEntity = await AssetPathEntity.fromId(id);
|
final assetPathEntity =
|
||||||
|
await AssetPathEntity.obtainPathFromProperties(id: id);
|
||||||
return _toAlbum(assetPathEntity);
|
return _toAlbum(assetPathEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user