File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/local/subscription Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,7 +75,12 @@ class SubscriptionManager(context: Context) {
7575 Completable .fromAction {
7676 entity.notificationMode = mode
7777 subscriptionTable().update(entity)
78- }.andThen(rememberLastStream(entity))
78+ }.apply {
79+ if (mode != NotificationMode .DISABLED ) {
80+ // notifications have just been enabled, mark all streams as "old"
81+ andThen(rememberAllStreams(entity))
82+ }
83+ }
7984 }
8085 }
8186
@@ -108,7 +113,12 @@ class SubscriptionManager(context: Context) {
108113 subscriptionTable.delete(subscriptionEntity)
109114 }
110115
111- private fun rememberLastStream (subscription : SubscriptionEntity ): Completable {
116+ /* *
117+ * Fetches the list of videos for the provided channel and saves them in the database, so that
118+ * they will be considered as "old"/"already seen" streams and the user will never notified
119+ * about any one of them.
120+ */
121+ private fun rememberAllStreams (subscription : SubscriptionEntity ): Completable {
112122 return ExtractorHelper .getChannelInfo(subscription.serviceId, subscription.url, false )
113123 .map { channel -> channel.relatedItems.map { stream -> StreamEntity (stream) } }
114124 .flatMapCompletable { entities ->
You can’t perform that action at this time.
0 commit comments