mirror of
https://github.com/immich-app/immich.git
synced 2025-05-30 19:54:52 -04: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
@ -5,7 +5,10 @@ abstract class ITimelineRepository {
|
|||||||
Stream<RenderList> watchArchiveTimeline(int userId);
|
Stream<RenderList> watchArchiveTimeline(int userId);
|
||||||
Stream<RenderList> watchFavoriteTimeline(int userId);
|
Stream<RenderList> watchFavoriteTimeline(int userId);
|
||||||
Stream<RenderList> watchTrashTimeline(int userId);
|
Stream<RenderList> watchTrashTimeline(int userId);
|
||||||
Stream<RenderList> watchAlbumTimeline(Album album);
|
Stream<RenderList> watchAlbumTimeline(
|
||||||
|
Album album,
|
||||||
|
GroupAssetsBy groupAssetsBy,
|
||||||
|
);
|
||||||
Stream<RenderList> watchAllVideosTimeline();
|
Stream<RenderList> watchAllVideosTimeline();
|
||||||
|
|
||||||
Stream<RenderList> watchHomeTimeline(int userId, GroupAssetsBy groupAssetsBy);
|
Stream<RenderList> watchHomeTimeline(int userId, GroupAssetsBy groupAssetsBy);
|
||||||
|
@ -42,14 +42,17 @@ class TimelineRepository extends DatabaseRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Stream<RenderList> watchAlbumTimeline(Album album) {
|
Stream<RenderList> watchAlbumTimeline(
|
||||||
|
Album album,
|
||||||
|
GroupAssetsBy groupAssetByOption,
|
||||||
|
) {
|
||||||
final query = album.assets.filter().isTrashedEqualTo(false);
|
final query = album.assets.filter().isTrashedEqualTo(false);
|
||||||
final withSortedOption = switch (album.sortOrder) {
|
final withSortedOption = switch (album.sortOrder) {
|
||||||
SortOrder.asc => query.sortByFileCreatedAt(),
|
SortOrder.asc => query.sortByFileCreatedAt(),
|
||||||
SortOrder.desc => query.sortByFileCreatedAtDesc(),
|
SortOrder.desc => query.sortByFileCreatedAtDesc(),
|
||||||
};
|
};
|
||||||
|
|
||||||
return _watchRenderList(withSortedOption, GroupAssetsBy.none);
|
return _watchRenderList(withSortedOption, groupAssetByOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -50,7 +50,10 @@ class TimelineService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Stream<RenderList> watchAlbumTimeline(Album album) async* {
|
Stream<RenderList> watchAlbumTimeline(Album album) async* {
|
||||||
yield* _timelineRepository.watchAlbumTimeline(album);
|
yield* _timelineRepository.watchAlbumTimeline(
|
||||||
|
album,
|
||||||
|
_getGroupByOption(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Stream<RenderList> watchTrashTimeline() async* {
|
Stream<RenderList> watchTrashTimeline() async* {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user