Skip to content

Commit

Permalink
feat(mobile): watch asset selection timeline group by date in album
Browse files Browse the repository at this point in the history
  • Loading branch information
ExceptionsOccur authored and ExceptionsOccur committed Mar 3, 2025
1 parent 6bf2e8d commit a7faf7b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion mobile/lib/interfaces/timeline.interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ abstract class ITimelineRepository {
GroupAssetsBy getGroupByOption,
);

Stream<RenderList> watchAssetSelectionTimeline(int userId);
Stream<RenderList> watchAssetSelectionTimeline(
int userId,
GroupAssetsBy getGroupByOption,
);
}
7 changes: 5 additions & 2 deletions mobile/lib/repositories/timeline.repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ class TimelineRepository extends DatabaseRepository
}

@override
Stream<RenderList> watchAssetSelectionTimeline(int userId) {
Stream<RenderList> watchAssetSelectionTimeline(
int userId,
GroupAssetsBy groupAssetByOption,
) {
final query = db.assets
.where()
.remoteIdIsNotNull()
Expand All @@ -130,7 +133,7 @@ class TimelineRepository extends DatabaseRepository
.stackPrimaryAssetIdIsNull()
.sortByFileCreatedAtDesc();

return _watchRenderList(query, GroupAssetsBy.none);
return _watchRenderList(query, groupAssetByOption);
}

Stream<RenderList> _watchRenderList(
Expand Down
5 changes: 4 additions & 1 deletion mobile/lib/services/timeline.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ class TimelineService {
Stream<RenderList> watchAssetSelectionTimeline() async* {
final user = await _userRepository.me();

yield* _timelineRepository.watchAssetSelectionTimeline(user.isarId);
yield* _timelineRepository.watchAssetSelectionTimeline(
user.isarId,
_getGroupByOption(),
);
}

GroupAssetsBy _getGroupByOption() {
Expand Down

0 comments on commit a7faf7b

Please sign in to comment.