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:
FineFindus 2025-01-23 14:29:10 +01:00
parent 284add62dd
commit c3be28e23b
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
2 changed files with 2 additions and 1 deletions

View File

@ -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(

View File

@ -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,