From 8715e7dd98a2cae350b329eae956dc17f007a3c8 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sun, 22 Aug 2021 19:39:13 +0200 Subject: [PATCH] Only show "mark as watched" context menu entry when watch history is enabled --- .../java/org/schabi/newpipe/local/feed/FeedFragment.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt index df7c57823..d3f6afeb6 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt @@ -349,7 +349,15 @@ class FeedFragment : BaseStateFragment() { ) ) } - if (item.streamType != StreamType.AUDIO_LIVE_STREAM && item.streamType != StreamType.LIVE_STREAM) { + + // show "mark as watched" only when watch history is enabled + val isWatchHistoryEnabled = PreferenceManager + .getDefaultSharedPreferences(context) + .getBoolean(getString(R.string.enable_watch_history_key), false) + if (item.streamType != StreamType.AUDIO_LIVE_STREAM && + item.streamType != StreamType.LIVE_STREAM && + isWatchHistoryEnabled + ) { entries.add( StreamDialogEntry.mark_as_watched )