fix: 视频/直播贴屏蔽
This commit is contained in:
parent
fdd0a2d606
commit
b91e23f995
|
|
@ -55,9 +55,12 @@ object FrsPageRepository {
|
|||
.map { response ->
|
||||
if (response.data_ == null) throw TiebaUnknownException
|
||||
val userList = response.data_.user_list
|
||||
val threadList = response.data_.thread_list.map { threadInfo ->
|
||||
threadInfo.copy(author = userList.find { it.id == threadInfo.authorId })
|
||||
}
|
||||
val threadList = response.data_.thread_list
|
||||
.map { threadInfo ->
|
||||
threadInfo.copy(author = userList.find { it.id == threadInfo.authorId })
|
||||
}
|
||||
.filter { !App.INSTANCE.appPreferences.blockVideo || it.videoInfo == null }
|
||||
.filter { it.ala_info == null } // 去他妈的直播
|
||||
response.copy(data_ = response.data_.copy(thread_list = threadList))
|
||||
}
|
||||
}
|
||||
|
|
@ -70,9 +70,11 @@ class PersonalizedViewModel @Inject constructor() :
|
|||
PersonalizedRepository
|
||||
.personalizedFlow(1, 1)
|
||||
.map<PersonalizedResponse, PersonalizedPartialChange.Refresh> { response ->
|
||||
val data = response.toData().filter {
|
||||
!App.INSTANCE.appPreferences.blockVideo || it.get { videoInfo } == null
|
||||
}
|
||||
val data = response.toData()
|
||||
.filter {
|
||||
!App.INSTANCE.appPreferences.blockVideo || it.get { videoInfo } == null
|
||||
}
|
||||
.filter { it.get { ala_info } == null }
|
||||
val threadPersonalizedData = response.data_?.thread_personalized ?: emptyList()
|
||||
PersonalizedPartialChange.Refresh.Success(
|
||||
data = data.map { thread ->
|
||||
|
|
@ -90,9 +92,11 @@ class PersonalizedViewModel @Inject constructor() :
|
|||
PersonalizedRepository
|
||||
.personalizedFlow(2, page)
|
||||
.map<PersonalizedResponse, PersonalizedPartialChange.LoadMore> { response ->
|
||||
val data = response.toData().filter {
|
||||
!App.INSTANCE.appPreferences.blockVideo || it.get { videoInfo } == null
|
||||
}
|
||||
val data = response.toData()
|
||||
.filter {
|
||||
!App.INSTANCE.appPreferences.blockVideo || it.get { videoInfo } == null
|
||||
}
|
||||
.filter { it.get { ala_info } == null }
|
||||
val threadPersonalizedData = response.data_?.thread_personalized ?: emptyList()
|
||||
PersonalizedPartialChange.LoadMore.Success(
|
||||
currentPage = page,
|
||||
|
|
|
|||
Loading…
Reference in New Issue