diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-10-11 12:18:07 +0200 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2016-01-26 23:46:30 +0100 |
commit | 5b7db9398abaacea241d9fcce7885457c562d7fa (patch) | |
tree | ef8982202ac7492892ba184c66c67a303c8cc795 /src/web/views/feed.py | |
parent | assigning categories to feeds and articles (diff) | |
download | newspipe-5b7db9398abaacea241d9fcce7885457c562d7fa.tar.gz newspipe-5b7db9398abaacea241d9fcce7885457c562d7fa.tar.bz2 newspipe-5b7db9398abaacea241d9fcce7885457c562d7fa.zip |
a bit of cleaning, putting code where it belongs
Diffstat (limited to 'src/web/views/feed.py')
-rw-r--r-- | src/web/views/feed.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/web/views/feed.py b/src/web/views/feed.py index 68d8765a..6569d1b7 100644 --- a/src/web/views/feed.py +++ b/src/web/views/feed.py @@ -217,3 +217,29 @@ def process_form(feed_id=None): flash(gettext("Downloading articles for the new feed..."), 'info') return redirect(url_for('feed.form', feed_id=new_feed.id)) + + +@feeds_bp.route('/inactives', methods=['GET']) +@login_required +def inactives(): + """ + List of inactive feeds. + """ + nb_days = int(request.args.get('nb_days', 365)) + inactives = FeedController(g.user.id).get_inactives(nb_days) + return render_template('inactives.html', + inactives=inactives, nb_days=nb_days) + + +@feed_bp.route('/duplicates/<int:feed_id>', methods=['GET']) +@login_required +def duplicates(feed_id): + """ + Return duplicates article for a feed. + """ + feed, duplicates = FeedController(g.user.id).get_duplicates(feed_id) + if len(duplicates) == 0: + flash(gettext('No duplicates in the feed "{}".').format(feed.title), + 'info') + return redirect('home') + return render_template('duplicates.html', duplicates=duplicates, feed=feed) |