Fix for #1845 (ods not working in Moonreader an Librera)

Fix opds search with wrong parameter no longer causes error 500
This commit is contained in:
Ozzie Isaacs 2021-03-21 11:57:42 +01:00
parent 9c842f1895
commit 33bdc07f55
3 changed files with 6 additions and 5 deletions

View File

@ -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")

View File

@ -11,18 +11,18 @@
<link rel="up"
href="{{url_for('opds.feed_index')}}"
type="application/atom+xml;profile=opds-catalog;type=feed;kind=navigation"/>
{% if pagination.has_prev %}
{% if pagination and pagination.has_prev %}
<link rel="first"
href="{{request.script_root + request.path}}"
type="application/atom+xml;profile=opds-catalog;type=feed;kind=navigation"/>
{% endif %}
{% if pagination.has_next %}
{% if pagination and pagination.has_next %}
<link rel="next"
title="{{_('Next')}}"
href="{{ request.script_root + request.path }}?offset={{ pagination.next_offset }}"
type="application/atom+xml;profile=opds-catalog;type=feed;kind=navigation"/>
{% endif %}
{% if pagination.has_prev %}
{% if pagination and pagination.has_prev %}
<link rel="previous"
href="{{request.script_root + request.path}}?offset={{ pagination.previous_offset }}"
type="application/atom+xml;profile=opds-catalog;type=feed;kind=navigation"/>
@ -30,7 +30,7 @@
<link rel="search"
href="{{url_for('opds.feed_osd')}}"
type="application/opensearchdescription+xml"/>
<!--link title="{{_('Search')}}" type="application/atom+xml" href="{{url_for('opds.feed_normal_search')}}?query={searchTerms}" rel="search"/-->
<link type="application/atom+xml" rel="search" title="{{_('Search')}}" href="{{url_for('opds.feed_cc_search')}}/{searchTerms}" />
<title>{{instance}}</title>
<author>
<name>{{instance}}</name>

View File

@ -8,6 +8,7 @@
<link rel="search"
href="{{url_for('opds.feed_osd')}}"
type="application/opensearchdescription+xml"/>
<link type="application/atom+xml" rel="search" title="{{_('Search')}}" href="{{url_for('opds.feed_cc_search')}}/{searchTerms}" />
<title>{{instance}}</title>
<author>
<name>{{instance}}</name>