diff options
author | cedricbonhomme <devnull@localhost> | 2012-03-04 10:41:27 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2012-03-04 10:41:27 +0100 |
commit | 3f9e9ff5d9902c0152008ad798ef5d03d47aab84 (patch) | |
tree | 4a8f48658fa037d925dcded1d6765918311e555e | |
parent | Right menu: OK. (diff) | |
download | newspipe-3f9e9ff5d9902c0152008ad798ef5d03d47aab84.tar.gz newspipe-3f9e9ff5d9902c0152008ad798ef5d03d47aab84.tar.bz2 newspipe-3f9e9ff5d9902c0152008ad798ef5d03d47aab84.zip |
Speed improvement in mark_as_read()
-rw-r--r-- | mongodb.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |