mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
fix(SubscriptionsFragment): skip all-caught-up check for upcoming videos
Skips the check if a video has been already seen (caught up on) for videos which have not been released yet, such as premieres. Doing the check could lead to the all caught up continously displayed for upcoming videos.
This commit is contained in:
parent
284add62dd
commit
c3be28e23b
@ -29,6 +29,7 @@ data class StreamItem(
|
||||
val isShort: Boolean = false
|
||||
) : Parcelable {
|
||||
val isLive get() = (duration == null) || (duration <= 0L)
|
||||
val isUpcoming get() = uploaded < System.currentTimeMillis()
|
||||
|
||||
fun toLocalPlaylistItem(playlistId: String): LocalPlaylistItem {
|
||||
return LocalPlaylistItem(
|
||||
|
@ -358,7 +358,7 @@ class SubscriptionsFragment : DynamicLayoutManagerFragment(R.layout.fragment_sub
|
||||
// add an "all caught up item"
|
||||
if (selectedSortOrder == 0) {
|
||||
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) {
|
||||
sortedFeed.add(
|
||||
caughtUpIndex,
|
||||
|
Loading…
x
Reference in New Issue
Block a user