From 33bdc07f5599c4c0e1531a9b49b41a1a079094ec Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 21 Mar 2021 11:57:42 +0100 Subject: [PATCH] Fix for #1845 (ods not working in Moonreader an Librera) Fix opds search with wrong parameter no longer causes error 500 --- cps/opds.py | 2 +- cps/templates/feed.xml | 8 ++++---- cps/templates/index.xml | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cps/opds.py b/cps/opds.py index c66ee836..e8d3fad9 100644 --- a/cps/opds.py +++ b/cps/opds.py @@ -94,7 +94,7 @@ def feed_cc_search(query): @opds.route("/opds/search", methods=["GET"]) @requires_basic_auth_if_no_ano def feed_normal_search(): - return feed_search(request.args.get("query").strip()) + return feed_search(request.args.get("query", "").strip()) @opds.route("/opds/new") diff --git a/cps/templates/feed.xml b/cps/templates/feed.xml index 4b65b1ca..4ad1db8c 100644 --- a/cps/templates/feed.xml +++ b/cps/templates/feed.xml @@ -11,18 +11,18 @@ -{% if pagination.has_prev %} +{% if pagination and pagination.has_prev %} {% endif %} -{% if pagination.has_next %} +{% if pagination and pagination.has_next %} {% endif %} -{% if pagination.has_prev %} +{% if pagination and pagination.has_prev %} @@ -30,7 +30,7 @@ - + {{instance}} {{instance}} diff --git a/cps/templates/index.xml b/cps/templates/index.xml index 6a69d732..c6a6e8f0 100644 --- a/cps/templates/index.xml +++ b/cps/templates/index.xml @@ -8,6 +8,7 @@ + {{instance}} {{instance}}