mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 15:30:31 +05:30
Merge pull request #7320 from FineFindus/fix/update-last-watchtime
fix(Feed): only update `LastFeedWatchedTime` when update time is newer
This commit is contained in:
commit
805d1f28c3
@ -104,8 +104,12 @@ object PreferenceHelper {
|
||||
return getString(PreferenceKeys.LAST_STREAM_VIDEO_ID, "")
|
||||
}
|
||||
|
||||
fun setLastFeedWatchedTime(time: Long) {
|
||||
putLong(PreferenceKeys.LAST_WATCHED_FEED_TIME, time)
|
||||
fun updateLastFeedWatchedTime(time: Long) {
|
||||
// only update the time if the time is newer
|
||||
// this avoids cases, where the user last saw an older video, which had already been seen,
|
||||
// causing all following video to be incorrectly marked as unseen again
|
||||
if (getLastCheckedFeedTime() < time)
|
||||
putLong(PreferenceKeys.LAST_WATCHED_FEED_TIME, time)
|
||||
}
|
||||
|
||||
fun getLastCheckedFeedTime(): Long {
|
||||
|
@ -398,7 +398,7 @@ class SubscriptionsFragment : DynamicLayoutManagerFragment(R.layout.fragment_sub
|
||||
binding.toggleSubs.text = getString(R.string.subscriptions)
|
||||
|
||||
feed.firstOrNull { !it.isUpcoming }?.uploaded?.let {
|
||||
PreferenceHelper.setLastFeedWatchedTime(it)
|
||||
PreferenceHelper.updateLastFeedWatchedTime(it)
|
||||
}
|
||||
|
||||
binding.subRefresh.isRefreshing = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user