From 691898e9226fed4ac191819fafd86961a73d6c8e Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 17 Mar 2011 22:15:29 -0400 Subject: [PATCH] Changing how unreads are calculated. If all stories are red, that's OK for now. Prevents the weird situation when training a feed and everything switches colors at once (same author or something), and when the unreads cycle through red, then everything gets marked as read. Not the desired behavior. And who is this helping, anyhow? --- apps/analyzer/views.py | 4 +--- apps/reader/models.py | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/analyzer/views.py b/apps/analyzer/views.py index c10a26131..222504fa5 100644 --- a/apps/analyzer/views.py +++ b/apps/analyzer/views.py @@ -17,7 +17,7 @@ def index(requst): @json.json_view def save_classifier(request): post = request.POST - logging.user(request.user, "~FGSaving classifier: ~FW%s" % (post)) + logging.user(request.user, "~FGSaving classifier: ~SB%s~SN ~FW%s" % (feed, post)) feed_id = int(post['feed_id']) feed = get_object_or_404(Feed, pk=feed_id) code = 0 @@ -73,8 +73,6 @@ def save_classifier(request): _save_classifier(MClassifierTag, 'tag') _save_classifier(MClassifierTitle, 'title') _save_classifier(MClassifierFeed, 'feed') - - logging.user(request.user, "~FGFeed training: ~SB%s" % (feed)) response = dict(code=code, message=message, payload=payload) return response diff --git a/apps/reader/models.py b/apps/reader/models.py index cb1483dbc..dd49923b8 100644 --- a/apps/reader/models.py +++ b/apps/reader/models.py @@ -238,10 +238,10 @@ class UserSubscription(models.Model): self.needs_unread_recalc = False self.save() - - if (self.unread_count_positive == 0 and - self.unread_count_neutral == 0): - self.mark_feed_read() + + # if (self.unread_count_positive == 0 and + # self.unread_count_neutral == 0): + # self.mark_feed_read() cache.delete('usersub:%s' % self.user.id)