fix(SubscriptionsFragment): skip upcoming videos when adding caught-up

Fixes a regression introduced in
d34d34e9e6,
which caused the original fix (111cd1b350)
to no longer function correctly.
This commit is contained in:
FineFindus 2025-02-23 14:27:26 +01:00
parent facd58ba64
commit 911fb5d358
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B

View File

@ -378,7 +378,7 @@ class SubscriptionsFragment : DynamicLayoutManagerFragment(R.layout.fragment_sub
if (selectedSortOrder == 0) {
val lastCheckedFeedTime = PreferenceHelper.getLastCheckedFeedTime()
val caughtUpIndex = feed.indexOfFirst { it.uploaded <= lastCheckedFeedTime && !it.isUpcoming }
if (caughtUpIndex > 0) {
if (caughtUpIndex > 0 && !feed[caughtUpIndex-1].isUpcoming) {
sorted.add(
caughtUpIndex,
StreamItem(type = VideosAdapter.CAUGHT_UP_STREAM_TYPE)