mirror of
https://github.com/immich-app/immich.git
synced 2025-03-30 12:49:38 +02:00
feat(mobile): photos group by date in album page view (#16272)
* feat(mobile): photos group by date in album page view * fix: format --------- Co-authored-by: ExceptionsOccur <yuyu.tao@foxmail.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
579321251f
commit
c0fe98fe27
3 changed files with 13 additions and 4 deletions
mobile/lib
|
@ -5,7 +5,10 @@ abstract class ITimelineRepository {
|
|||
Stream<RenderList> watchArchiveTimeline(int userId);
|
||||
Stream<RenderList> watchFavoriteTimeline(int userId);
|
||||
Stream<RenderList> watchTrashTimeline(int userId);
|
||||
Stream<RenderList> watchAlbumTimeline(Album album);
|
||||
Stream<RenderList> watchAlbumTimeline(
|
||||
Album album,
|
||||
GroupAssetsBy groupAssetsBy,
|
||||
);
|
||||
Stream<RenderList> watchAllVideosTimeline();
|
||||
|
||||
Stream<RenderList> watchHomeTimeline(int userId, GroupAssetsBy groupAssetsBy);
|
||||
|
|
|
@ -42,14 +42,17 @@ class TimelineRepository extends DatabaseRepository
|
|||
}
|
||||
|
||||
@override
|
||||
Stream<RenderList> watchAlbumTimeline(Album album) {
|
||||
Stream<RenderList> watchAlbumTimeline(
|
||||
Album album,
|
||||
GroupAssetsBy groupAssetByOption,
|
||||
) {
|
||||
final query = album.assets.filter().isTrashedEqualTo(false);
|
||||
final withSortedOption = switch (album.sortOrder) {
|
||||
SortOrder.asc => query.sortByFileCreatedAt(),
|
||||
SortOrder.desc => query.sortByFileCreatedAtDesc(),
|
||||
};
|
||||
|
||||
return _watchRenderList(withSortedOption, GroupAssetsBy.none);
|
||||
return _watchRenderList(withSortedOption, groupAssetByOption);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -50,7 +50,10 @@ class TimelineService {
|
|||
}
|
||||
|
||||
Stream<RenderList> watchAlbumTimeline(Album album) async* {
|
||||
yield* _timelineRepository.watchAlbumTimeline(album);
|
||||
yield* _timelineRepository.watchAlbumTimeline(
|
||||
album,
|
||||
_getGroupByOption(),
|
||||
);
|
||||
}
|
||||
|
||||
Stream<RenderList> watchTrashTimeline() async* {
|
||||
|
|
Loading…
Add table
Reference in a new issue