mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
Merge pull request #3853 from Bnyro/master
Add feed filter for livestreams
This commit is contained in:
commit
0c6f84b39e
@ -220,10 +220,12 @@ class SubscriptionsFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
.filter {
|
.filter {
|
||||||
// apply the selected filter
|
// apply the selected filter
|
||||||
|
val isLive = (it.duration ?: -1L) < 0L
|
||||||
when (selectedFilter) {
|
when (selectedFilter) {
|
||||||
0 -> true
|
0 -> true
|
||||||
1 -> !it.isShort
|
1 -> !it.isShort && !isLive
|
||||||
2 -> it.isShort
|
2 -> it.isShort
|
||||||
|
3 -> isLive
|
||||||
else -> throw IllegalArgumentException()
|
else -> throw IllegalArgumentException()
|
||||||
}
|
}
|
||||||
}.let { streams ->
|
}.let { streams ->
|
||||||
|
@ -284,6 +284,7 @@
|
|||||||
<item>@string/all</item>
|
<item>@string/all</item>
|
||||||
<item>@string/videos</item>
|
<item>@string/videos</item>
|
||||||
<item>@string/yt_shorts</item>
|
<item>@string/yt_shorts</item>
|
||||||
|
<item>@string/livestreams</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="playlistSortOptions">
|
<string-array name="playlistSortOptions">
|
||||||
|
Loading…
Reference in New Issue
Block a user