diff --git a/Model/FeedModel.swift b/Model/FeedModel.swift index 3e13b782..4189d250 100644 --- a/Model/FeedModel.swift +++ b/Model/FeedModel.swift @@ -130,7 +130,9 @@ final class FeedModel: ObservableObject, CacheModel { } let byChannel = Dictionary(grouping: unwatched) { $0.channel.id }.mapValues(\.count) - self.unwatchedByChannel[account] = byChannel + if self.unwatchedByChannel[account] != byChannel { + self.unwatchedByChannel[account] = byChannel + } } } } diff --git a/Model/HistoryModel.swift b/Model/HistoryModel.swift index 14653419..bb23d1a6 100644 --- a/Model/HistoryModel.swift +++ b/Model/HistoryModel.swift @@ -107,8 +107,6 @@ extension PlayerModel { self.context.delete(watch) try? self.context.save() - - FeedModel.shared.calculateUnwatchedFeed() } } diff --git a/Shared/Videos/WatchView.swift b/Shared/Videos/WatchView.swift index 64e253d8..2128b8e8 100644 --- a/Shared/Videos/WatchView.swift +++ b/Shared/Videos/WatchView.swift @@ -42,8 +42,6 @@ struct WatchView: View { } else { Watch.markAsWatched(videoID: watch?.videoID ?? videoID, account: AccountsModel.shared.current, duration: watch?.videoDuration ?? duration, context: backgroundContext) } - - FeedModel.shared.calculateUnwatchedFeed() } var imageSystemName: String {