aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views/feed.py
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-07-06 11:47:45 +0200
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-07-06 13:54:05 +0200
commitc47e8fbd86eebd4c61888b1cba6cf39670679fd0 (patch)
treeb73d664257c1d4248538f79eb77b5b3d460e25ff /pyaggr3g470r/views/feed.py
parentlight refact (diff)
downloadnewspipe-c47e8fbd86eebd4c61888b1cba6cf39670679fd0.tar.gz
newspipe-c47e8fbd86eebd4c61888b1cba6cf39670679fd0.tar.bz2
newspipe-c47e8fbd86eebd4c61888b1cba6cf39670679fd0.zip
the icon isn't a url but a b64 dump
Diffstat (limited to 'pyaggr3g470r/views/feed.py')
-rw-r--r--pyaggr3g470r/views/feed.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/pyaggr3g470r/views/feed.py b/pyaggr3g470r/views/feed.py
index 4c848b0e..d84a68bc 100644
--- a/pyaggr3g470r/views/feed.py
+++ b/pyaggr3g470r/views/feed.py
@@ -1,17 +1,18 @@
#! /usr/bin/env python
# -*- coding: utf-8 -
+import base64
from datetime import datetime
from sqlalchemy import desc
from werkzeug.exceptions import BadRequest
from flask import Blueprint, g, render_template, flash, \
- redirect, request, url_for
+ redirect, request, url_for, Response
from flask.ext.babel import gettext
from flask.ext.login import login_required
import conf
from pyaggr3g470r import utils
-from pyaggr3g470r.lib.feed.utils import construct_feed_from
+from pyaggr3g470r.lib.feed_utils import construct_feed_from
from pyaggr3g470r.forms import AddFeedForm
from pyaggr3g470r.controllers import FeedController, ArticleController
@@ -182,3 +183,9 @@ 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))
+
+
+@feed_bp.route('/icon/<int:feed_id>', methods=['GET'])
+def icon(feed_id):
+ return Response(base64.b64decode(FeedController().get(id=feed_id).icon),
+ mimetype='image')
bgstack15