fix(creator): 커뮤니티 게시글 표시 정책을 보정한다

This commit is contained in:
2026-06-22 00:36:42 +09:00
parent 7ccc676192
commit 318944fbfe
4 changed files with 28 additions and 7 deletions

View File

@@ -2,7 +2,6 @@ package kr.co.vividnext.sodalive.v2.creator.channel.community
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.orhanobut.logger.Logger
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
import kr.co.vividnext.sodalive.base.BaseViewModel
@@ -127,7 +126,6 @@ class CreatorChannelCommunityViewModel(
{
if (generation != requestGeneration) return@subscribe
it.message?.let { message -> Logger.e(message) }
val current = _communityStateLiveData.value as? CreatorChannelCommunityUiState.Content
_communityStateLiveData.value = if (current != null && page > FIRST_PAGE) {
current.copy(isLoadingMore = false, paginationErrorMessage = it.message)

View File

@@ -20,7 +20,8 @@ private fun CreatorChannelCommunityPostResponse.toCommunityPostUiModel(
): CreatorChannelCommunityPostUiModel {
val isLocked = price > 0 && !existOrdered && !isOwner
val showOwnerActions = isOwner && creatorId == currentUserId
val showPlayButton = !isLocked && !audioUrl.isNullOrBlank() && !imageUrl.isNullOrBlank()
val visibleImageUrl = imageUrl.takeUnless { isLocked }
val showPlayButton = !isLocked && !audioUrl.isNullOrBlank() && !visibleImageUrl.isNullOrBlank()
return CreatorChannelCommunityPostUiModel(
postId = postId,
creatorId = creatorId,
@@ -28,7 +29,7 @@ private fun CreatorChannelCommunityPostResponse.toCommunityPostUiModel(
creatorProfileUrl = creatorProfileUrl,
createdAtText = relativeTimeTextFormatter.format(createdAtUtc),
content = content,
imageUrl = imageUrl,
imageUrl = visibleImageUrl,
audioUrl = audioUrl,
price = price,
existOrdered = existOrdered,
@@ -36,18 +37,22 @@ private fun CreatorChannelCommunityPostResponse.toCommunityPostUiModel(
commentCount = commentCount,
showComment = isCommentAvailable,
showNotice = isPinned,
isPinned = isPinned,
isLocked = isLocked,
showOwnerMore = showOwnerActions,
showOwnerTopPrice = showOwnerActions && price > 0,
showPlayButton = showPlayButton,
gridPreviewText = content.toGridPreviewText(),
imageMode = toImageMode(isLocked)
imageMode = toImageMode(isLocked, visibleImageUrl)
)
}
private fun CreatorChannelCommunityPostResponse.toImageMode(isLocked: Boolean): CreatorChannelCommunityImageMode = when {
private fun CreatorChannelCommunityPostResponse.toImageMode(
isLocked: Boolean,
visibleImageUrl: String?
): CreatorChannelCommunityImageMode = when {
isLocked -> CreatorChannelCommunityImageMode.LockedGray
imageUrl.isNullOrBlank() -> CreatorChannelCommunityImageMode.TextPreview
visibleImageUrl.isNullOrBlank() -> CreatorChannelCommunityImageMode.TextPreview
else -> CreatorChannelCommunityImageMode.Image
}

View File

@@ -39,6 +39,7 @@ data class CreatorChannelCommunityPostUiModel(
val commentCount: Int,
val showComment: Boolean,
val showNotice: Boolean,
val isPinned: Boolean,
val isLocked: Boolean,
val showOwnerMore: Boolean,
val showOwnerTopPrice: Boolean,