Function
removeThread
(threadList, filterVideo)
Source from the content-addressed store, hash-verified
| 210 | } |
| 211 | |
| 212 | function removeThread(threadList, filterVideo) { |
| 213 | let newThreadList = threadList; |
| 214 | let liveCount = 0; |
| 215 | let videoCount = 0; |
| 216 | if(threadList?.length){ |
| 217 | newThreadList = threadList.filter(item => { |
| 218 | if(item.alaInfo){ |
| 219 | liveCount++; |
| 220 | return false; |
| 221 | } else if(filterVideo && item.videoInfo){ |
| 222 | videoCount++; |
| 223 | return false; |
| 224 | } |
| 225 | return true; |
| 226 | }); |
| 227 | console.log(`去除帖子:直播${liveCount} / 视频${videoCount}`) |
| 228 | } else { |
| 229 | console.log('无需处理threadList'); |
| 230 | } |
| 231 | return newThreadList; |
| 232 | } |
Tested by
no test coverage detected