aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2012-03-04 10:41:27 +0100
committercedricbonhomme <devnull@localhost>2012-03-04 10:41:27 +0100
commit3f9e9ff5d9902c0152008ad798ef5d03d47aab84 (patch)
tree4a8f48658fa037d925dcded1d6765918311e555e
parentRight menu: OK. (diff)
downloadnewspipe-3f9e9ff5d9902c0152008ad798ef5d03d47aab84.tar.gz
newspipe-3f9e9ff5d9902c0152008ad798ef5d03d47aab84.tar.bz2
newspipe-3f9e9ff5d9902c0152008ad798ef5d03d47aab84.zip
Speed improvement in mark_as_read()
-rw-r--r--mongodb.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mongodb.py b/mongodb.py
index 8c1cc59d..56a83b11 100644
--- a/mongodb.py
+++ b/mongodb.py
@@ -161,10 +161,10 @@ class Articles(object):
"""
if feed_id != None and article_id != None:
collection = self.db[str(feed_id)]
- collection.update({"article_id": article_id}, {"$set": {"article_readed": readed}})
+ collection.update({"article_id": article_id, "article_readed":not readed}, {"$set": {"article_readed": readed}})
elif feed_id != None and article_id == None:
collection = self.db[str(feed_id)]
- collection.update({"type": 1}, {"$set": {"article_readed": readed}}, multi=True)
+ collection.update({"type": 1, "article_readed":not readed}, {"$set": {"article_readed": readed}}, multi=True)
else:
for feed_id in self.db.collection_names():
self.mark_as_read(readed, feed_id, None)
bgstack15