Skip to content

Commit

Permalink
fix: rename method (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
chivehao authored Aug 28, 2024
1 parent 794f3a4 commit e1c7d46
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public Mono<Subject> findById(Long id) {
.setTotalEpisodes((long) episodes.size())
.setEpisodes(episodes)
.setCanRead(getSubjectCanReadByEpisodes(episodes)))
.flatMap(sub -> findMatchingEpisodCount(sub.getId())
.flatMap(sub -> findMatchingEpisodeCount(sub.getId())
.map(sub::setMatchingEpisodes))
.switchIfEmpty(Mono.just(subject)))
.checkpoint("FindEpisodeEntitiesBySubjectId")
Expand Down Expand Up @@ -362,7 +362,7 @@ public Mono<Void> deleteById(Long id) {
;
}

private Mono<Long> findMatchingEpisodCount(Long subjectId) {
private Mono<Long> findMatchingEpisodeCount(Long subjectId) {
return episodeRepository.findAllBySubjectId(subjectId)
.map(EpisodeEntity::getId)
.filterWhen(epId -> attachmentReferenceRepository.existsByTypeAndReferenceId(
Expand All @@ -386,7 +386,7 @@ public Mono<PagingWrap<SubjectMeta>> findAllByPageable(PagingWrap<Subject> pagin
.flatMap(subjectRepository::findById)
.flatMap(
subject -> ReactiveBeanUtils.copyProperties(subject, new SubjectMeta()))
.flatMap(subjectMeta -> findMatchingEpisodCount(subjectMeta.getId())
.flatMap(subjectMeta -> findMatchingEpisodeCount(subjectMeta.getId())
.map(subjectMeta::setMatchingEpisodes))
.flatMap(subjectMeta -> episodeRepository.countBySubjectId(subjectMeta.getId())
.map(subjectMeta::setTotalEpisodes))
Expand Down Expand Up @@ -445,7 +445,7 @@ public Mono<PagingWrap<SubjectMeta>> listEntitiesByCondition(FindSubjectConditio
return subjectEntityFlux.map(BaseEntity::getId)
.flatMap(subjectRepository::findById)
.flatMap(subject -> ReactiveBeanUtils.copyProperties(subject, new SubjectMeta()))
.flatMap(subjectMeta -> findMatchingEpisodCount(subjectMeta.getId())
.flatMap(subjectMeta -> findMatchingEpisodeCount(subjectMeta.getId())
.map(subjectMeta::setMatchingEpisodes))
.flatMap(subjectMeta -> episodeRepository.countBySubjectId(subjectMeta.getId())
.map(subjectMeta::setTotalEpisodes))
Expand Down

0 comments on commit e1c7d46

Please sign in to comment.