1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-10 12:00:01 +00:00

Fix for opds feed of unread/read books

This commit is contained in:
Ozzieisaacs 2019-04-19 12:07:46 +02:00
parent 544405f5aa
commit c748716ad2

View File

@ -724,6 +724,7 @@ def before_request():
# Routing functions # Routing functions
@app.route("/opds/")
@app.route("/opds") @app.route("/opds")
@requires_basic_auth_if_no_ano @requires_basic_auth_if_no_ano
def feed_index(): def feed_index():
@ -2123,12 +2124,16 @@ def render_read_books(page, are_read, as_xml=False):
@app.route("/opds/readbooks/") @app.route("/opds/readbooks/")
@login_required_if_no_ano @requires_basic_auth_if_no_ano
def feed_read_books(): def feed_read_books():
off = request.args.get("offset") or 0 off = request.args.get("offset") or 0
return render_read_books(int(off) / (int(config.config_books_per_page)) + 1, True, True) return render_read_books(int(off) / (int(config.config_books_per_page)) + 1, True, True)
@app.route("/favicon.ico")
def favicon():
return send_from_directory(os.path.join(os.path.dirname(__file__), "static"), "favicon.ico")
@app.route("/readbooks/", defaults={'page': 1}) @app.route("/readbooks/", defaults={'page': 1})
@app.route("/readbooks/<int:page>") @app.route("/readbooks/<int:page>")
@login_required_if_no_ano @login_required_if_no_ano
@ -2137,7 +2142,7 @@ def read_books(page):
@app.route("/opds/unreadbooks/") @app.route("/opds/unreadbooks/")
@login_required_if_no_ano @requires_basic_auth_if_no_ano
def feed_unread_books(): def feed_unread_books():
off = request.args.get("offset") or 0 off = request.args.get("offset") or 0
return render_read_books(int(off) / (int(config.config_books_per_page)) + 1, False, True) return render_read_books(int(off) / (int(config.config_books_per_page)) + 1, False, True)