mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(mobile): render list (#16303)
* refactor(mobile): render list 2 * wip * wip: asset selection page * remove render_list provider * remove dead code * yaml format * remove unused file * woop woop more clean up * woop woop more clean up 2 * fix: album selection doesn't load instantly
This commit is contained in:
parent
7c851893b4
commit
d0381fddec
26 changed files with 134 additions and 140 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/entities/album.entity.dart';
|
||||
import 'package:immich_mobile/entities/asset.entity.dart';
|
||||
import 'package:immich_mobile/interfaces/timeline.interface.dart';
|
||||
import 'package:immich_mobile/interfaces/user.interface.dart';
|
||||
import 'package:immich_mobile/providers/app_settings.provider.dart';
|
||||
|
|
@ -66,6 +67,29 @@ class TimelineService {
|
|||
return _timelineRepository.watchAllVideosTimeline();
|
||||
}
|
||||
|
||||
Future<RenderList> getTimelineFromAssets(
|
||||
List<Asset> assets,
|
||||
GroupAssetsBy? groupBy,
|
||||
) {
|
||||
GroupAssetsBy groupOption = GroupAssetsBy.none;
|
||||
if (groupBy != null) {
|
||||
groupOption = groupBy;
|
||||
} else {
|
||||
groupOption = _getGroupByOption();
|
||||
}
|
||||
|
||||
return _timelineRepository.getTimelineFromAssets(
|
||||
assets,
|
||||
groupOption,
|
||||
);
|
||||
}
|
||||
|
||||
Stream<RenderList> watchAssetSelectionTimeline() async* {
|
||||
final user = await _userRepository.me();
|
||||
|
||||
yield* _timelineRepository.watchAssetSelectionTimeline(user.isarId);
|
||||
}
|
||||
|
||||
GroupAssetsBy _getGroupByOption() {
|
||||
return GroupAssetsBy
|
||||
.values[_appSettingsService.getSetting(AppSettingsEnum.groupAssetsBy)];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue