콘텐츠 상세
- 이전화/다음화 추가
This commit is contained in:
@@ -440,7 +440,14 @@ class AudioContentService(
|
||||
}
|
||||
}
|
||||
|
||||
fun getDetail(id: Long, member: Member, timezone: String): GetAudioContentDetailResponse {
|
||||
fun getDetail(
|
||||
id: Long,
|
||||
member: Member,
|
||||
isAdultContentVisible: Boolean,
|
||||
timezone: String
|
||||
): GetAudioContentDetailResponse {
|
||||
val isAdult = member.auth != null && isAdultContentVisible
|
||||
|
||||
// 오디오 콘텐츠 조회 (content_id, 제목, 내용, 테마, 태그, 19여부, 이미지, 콘텐츠 PATH)
|
||||
val audioContent = repository.findByIdOrNull(id)
|
||||
?: throw SodaException("잘못된 콘텐츠 입니다.\n다시 시도해 주세요.")
|
||||
@@ -473,8 +480,26 @@ class AudioContentService(
|
||||
null
|
||||
}
|
||||
|
||||
val previousContent = repository.findPreviousContent(title = audioContent.title)
|
||||
val nextContent = repository.findNextContent(title = audioContent.title)
|
||||
val seriesId = repository.findSeriesIdByContentId(audioContent.id!!, isAdult)
|
||||
val previousContent = if (seriesId != null) {
|
||||
repository.findPreviousContent(
|
||||
seriesId = seriesId,
|
||||
title = audioContent.title,
|
||||
isAdult = isAdult
|
||||
)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
val nextContent = if (seriesId != null) {
|
||||
repository.findNextContent(
|
||||
seriesId = seriesId,
|
||||
title = audioContent.title,
|
||||
isAdult = isAdult
|
||||
)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
if (
|
||||
!isExistsAudioContent &&
|
||||
|
||||
Reference in New Issue
Block a user