diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-01-21 14:07:00 +0100 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-03-03 22:22:46 +0100 |
commit | 4f0ad9e442e64f69d420dea4d737805eefaaf981 (patch) | |
tree | 8625aca6c0313243aab5143df916df400edc4385 /pyaggr3g470r/controllers/feed.py | |
parent | first implementation of fetchable feeds (diff) | |
download | newspipe-4f0ad9e442e64f69d420dea4d737805eefaaf981.tar.gz newspipe-4f0ad9e442e64f69d420dea4d737805eefaaf981.tar.bz2 newspipe-4f0ad9e442e64f69d420dea4d737805eefaaf981.zip |
continuing refacto
Diffstat (limited to 'pyaggr3g470r/controllers/feed.py')
-rw-r--r-- | pyaggr3g470r/controllers/feed.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pyaggr3g470r/controllers/feed.py b/pyaggr3g470r/controllers/feed.py index ce1c413f..56cef997 100644 --- a/pyaggr3g470r/controllers/feed.py +++ b/pyaggr3g470r/controllers/feed.py @@ -16,8 +16,14 @@ class FeedController(AbstractController): max_last_refresh = now - timedelta(minutes=user.refresh_rate or 60) feeds = [feed for feed in self.read(user_id=self.user_id, error_count__le=max_error, - last_refreshed__lt=max_last_refresh).limit(limit)] + last_modified=max_last_refresh).limit(limit)] self.update({'id__in': [feed.id for feed in feeds]}, - {'last_refreshed': now}) + {'last_modified': now}) return feeds + + def list_last_articles(self, feed_id, limit=50): + from pyaggr3g470r.controllers import ArticleController + return ArticleController(self.user_id)._get(feed_id=feed_id)\ + .order_by(ArticleController._db_cls.retrieved_date.desc())\ + .limit(limit) |