mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
Merge pull request #7008 from FineFindus/fix/all-caught-up
fix(SubscriptionsFragment): skip all-caught-up check for upcoming videos
This commit is contained in:
commit
111cd1b350
@ -29,6 +29,7 @@ data class StreamItem(
|
|||||||
val isShort: Boolean = false
|
val isShort: Boolean = false
|
||||||
) : Parcelable {
|
) : Parcelable {
|
||||||
val isLive get() = (duration == null) || (duration <= 0L)
|
val isLive get() = (duration == null) || (duration <= 0L)
|
||||||
|
val isUpcoming get() = uploaded < System.currentTimeMillis()
|
||||||
|
|
||||||
fun toLocalPlaylistItem(playlistId: String): LocalPlaylistItem {
|
fun toLocalPlaylistItem(playlistId: String): LocalPlaylistItem {
|
||||||
return LocalPlaylistItem(
|
return LocalPlaylistItem(
|
||||||
|
@ -358,7 +358,7 @@ class SubscriptionsFragment : DynamicLayoutManagerFragment(R.layout.fragment_sub
|
|||||||
// add an "all caught up item"
|
// add an "all caught up item"
|
||||||
if (selectedSortOrder == 0) {
|
if (selectedSortOrder == 0) {
|
||||||
val lastCheckedFeedTime = PreferenceHelper.getLastCheckedFeedTime()
|
val lastCheckedFeedTime = PreferenceHelper.getLastCheckedFeedTime()
|
||||||
val caughtUpIndex = feed.indexOfFirst { it.uploaded / 1000 < lastCheckedFeedTime }
|
val caughtUpIndex = feed.indexOfFirst { it.uploaded / 1000 < lastCheckedFeedTime && !it.isUpcoming }
|
||||||
if (caughtUpIndex > 0) {
|
if (caughtUpIndex > 0) {
|
||||||
sortedFeed.add(
|
sortedFeed.add(
|
||||||
caughtUpIndex,
|
caughtUpIndex,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user