Skip to content

Commit 51ab533

Browse files
authored
Merge pull request libre-tube#7113 from FineFindus/feat/filter-members-videos
feat(LocalFeedRepository): filter members only videos
2 parents ca56ab6 + 5627a93 commit 51ab533

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

app/src/main/java/com/github/libretube/repo/LocalFeedRepository.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import org.schabi.newpipe.extractor.channel.tabs.ChannelTabInfo
2121
import org.schabi.newpipe.extractor.channel.tabs.ChannelTabs
2222
import org.schabi.newpipe.extractor.feed.FeedInfo
2323
import org.schabi.newpipe.extractor.stream.StreamInfoItem
24+
import org.schabi.newpipe.extractor.stream.StreamInfoItem.ContentAvailability
2425
import java.time.Duration
2526
import java.time.Instant
2627
import java.util.concurrent.atomic.AtomicInteger
@@ -146,6 +147,7 @@ class LocalFeedRepository : FeedRepository {
146147
ChannelTabInfo.getInfo(NewPipeExtractorInstance.extractor, tab).relatedItems
147148
}.getOrElse { emptyList() }
148149
}.flatten().filterIsInstance<StreamInfoItem>()
150+
.filter { it.contentAvailability == ContentAvailability.AVAILABLE || it.contentAvailability == ContentAvailability.UPCOMING }
149151

150152
val channelAvatar = channelInfo.avatars.maxByOrNull { it.height }?.url
151153
return related.map { item ->

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ buildscript {
1818

1919
allprojects {
2020
repositories {
21+
mavenLocal()
2122
google()
2223
mavenCentral()
2324
maven { setUrl("https://jitpack.io") }

0 commit comments

Comments
 (0)