diff --git a/cps/templates/feed.xml b/cps/templates/feed.xml
index 9454187b..82e92416 100644
--- a/cps/templates/feed.xml
+++ b/cps/templates/feed.xml
@@ -43,6 +43,9 @@
{{entry.authors[0].name}}
+
+ {{entry.publishers[0].name}}
+
{{entry.language}}
{% for tag in entry.tags %}
{{url_for('feed_authorindex')}}
{{ current_time }}
{{_('Books ordered by Author')}}
-
+
+
+ {{_('Publishers')}}
+
+ {{url_for('feed_publisherindex')}}
+ {{ current_time }}
+ {{_('Books ordered by publisher')}}
+
{{_('Category list')}}
diff --git a/cps/web.py b/cps/web.py
index 0f359fd6..4a397083 100644
--- a/cps/web.py
+++ b/cps/web.py
@@ -752,6 +752,26 @@ def feed_author(book_id):
return render_xml_template('feed.xml', entries=entries, pagination=pagination)
+@app.route("/opds/publisher")
+@requires_basic_auth_if_no_ano
+def feed_publisherindex():
+ off = request.args.get("offset") or 0
+ entries = db.session.query(db.Publishers).join(db.books_publishers_link).join(db.Books).filter(common_filters())\
+ .group_by('books_publishers_link.publisher').order_by(db.Publishers.sort).limit(config.config_books_per_page).offset(off)
+ pagination = Pagination((int(off) / (int(config.config_books_per_page)) + 1), config.config_books_per_page,
+ len(db.session.query(db.Publishers).all()))
+ return render_xml_template('feed.xml', listelements=entries, folder='feed_publisher', pagination=pagination)
+
+
+@app.route("/opds/publisher/")
+@requires_basic_auth_if_no_ano
+def feed_publisher(book_id):
+ off = request.args.get("offset") or 0
+ entries, __, pagination = fill_indexpage((int(off) / (int(config.config_books_per_page)) + 1),
+ db.Books, db.Books.publishers.any(db.Publishers.id == book_id), [db.Books.timestamp.desc()])
+ return render_xml_template('feed.xml', entries=entries, pagination=pagination)
+
+
@app.route("/opds/category")
@requires_basic_auth_if_no_ano
def feed_categoryindex():