From 88f31ddad1fabd59edb041313d2a7806adb1dff7 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Thu, 7 Nov 2019 21:04:03 +0100 Subject: [PATCH] Fix for #1034 --- cps/opds.py | 5 +++-- cps/templates/feed.xml | 2 +- cps/templates/index.xml | 24 ++++++++++++------------ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/cps/opds.py b/cps/opds.py index 44e1341d..e2930646 100644 --- a/cps/opds.py +++ b/cps/opds.py @@ -219,7 +219,7 @@ def feed_series(book_id): @requires_basic_auth_if_no_ano def feed_shelfindex(public): off = request.args.get("offset") or 0 - if public is not 0: + if public != 0: shelf = g.public_shelfes number = len(shelf) else: @@ -261,9 +261,10 @@ def opds_download_link(book_id, book_format): return get_download_link(book_id,book_format) +@opds.route("/ajax/book//") @opds.route("/ajax/book/") @requires_basic_auth_if_no_ano -def get_metadata_calibre_companion(uuid): +def get_metadata_calibre_companion(uuid, library): entry = db.session.query(db.Books).filter(db.Books.uuid.like("%" + uuid + "%")).first() if entry is not None: js = render_template('json.txt', entry=entry) diff --git a/cps/templates/feed.xml b/cps/templates/feed.xml index 473dc2d4..16548a91 100644 --- a/cps/templates/feed.xml +++ b/cps/templates/feed.xml @@ -41,7 +41,7 @@ {% for entry in entries %} {{entry.title}} - {{entry.uuid}} + urn:uuid:{{entry.uuid}} {{entry.atom_timestamp}} {% if entry.authors.__len__() > 0 %} diff --git a/cps/templates/index.xml b/cps/templates/index.xml index f7e8d6f0..f0ca1e2e 100644 --- a/cps/templates/index.xml +++ b/cps/templates/index.xml @@ -15,28 +15,28 @@ {{_('Hot Books')}} - + {{url_for('opds.feed_hot')}} {{ current_time }} {{_('Popular publications from this catalog based on Downloads.')}} {{_('Best rated Books')}} - + {{url_for('opds.feed_best_rated')}} {{ current_time }} {{_('Popular publications from this catalog based on Rating.')}} {{_('New Books')}} - + {{url_for('opds.feed_new')}} {{ current_time }} {{_('The latest Books')}} {{_('Random Books')}} - + {{url_for('opds.feed_discover')}} {{ current_time }} {{_('Show Random Books')}} @@ -44,14 +44,14 @@ {% if not current_user.is_anonymous %} {{_('Read Books')}} - + {{url_for('opds.feed_read_books')}} {{ current_time }} {{_('Read Books')}} {{_('Unread Books')}} - + {{url_for('opds.feed_unread_books')}} {{ current_time }} {{_('Unread Books')}} @@ -59,35 +59,35 @@ {% endif %} {{_('Authors')}} - + {{url_for('opds.feed_authorindex')}} {{ current_time }} {{_('Books ordered by Author')}} {{_('Publishers')}} - + {{url_for('opds.feed_publisherindex')}} {{ current_time }} {{_('Books ordered by publisher')}} {{_('Category list')}} - + {{url_for('opds.feed_categoryindex')}} {{ current_time }} {{_('Books ordered by category')}} {{_('Series list')}} - + {{url_for('opds.feed_seriesindex')}} {{ current_time }} {{_('Books ordered by series')}} {{_('Public Shelves')}} - + {{url_for('opds.feed_shelfindex', public="public")}} {{ current_time }} {{_('Books organized in public shelfs, visible to everyone')}} @@ -95,7 +95,7 @@ {% if not current_user.is_anonymous %} {{_('Your Shelves')}} - + {{url_for('opds.feed_shelfindex')}} {{ current_time }} {{_("User's own shelfs, only visible to the current user himself")}}