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:
Bnyro 2025-01-23 16:44:15 +01:00 committed by GitHub
commit 111cd1b350
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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,