diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-09-08 15:14:46 +0200 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-09-08 15:14:46 +0200 |
commit | 6c3323f2e6931cacf4250789358690ce44c90af4 (patch) | |
tree | 871f28752574e9e26f85031d8354070594d2bec2 /source/mongodb.py | |
parent | Fixed minor bugs. (diff) | |
download | newspipe-6c3323f2e6931cacf4250789358690ce44c90af4.tar.gz newspipe-6c3323f2e6931cacf4250789358690ce44c90af4.tar.bz2 newspipe-6c3323f2e6931cacf4250789358690ce44c90af4.zip |
Change the name of the collection when the url of a feed is changed.
Diffstat (limited to 'source/mongodb.py')
-rw-r--r-- | source/mongodb.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/mongodb.py b/source/mongodb.py index 7dc83394..04cd44fa 100644 --- a/source/mongodb.py +++ b/source/mongodb.py @@ -231,6 +231,8 @@ class Articles(object): """ collection = self.db[str(feed_id)] collection.update({"type": 0, "feed_id":feed_id}, {"$set": changes}, multi=True) + if "feed_id" in changes.keys(): + self.db[str(feed_id)].rename(str(changes["feed_id"])) # Functions on database def drop_database(self): |