From ecea7e7493b59faa45875bdc2e584492c35a2e8d Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 22 Nov 2020 10:06:54 +0100 Subject: [PATCH] Revert "Fix browser caching problem on change cover" This reverts commit b9536812f4d294fe78bd0c90ac9b53ca1e16ccb1. --- cps/editbooks.py | 17 +++++++---------- cps/templates/book_edit.html | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/cps/editbooks.py b/cps/editbooks.py index ceccf359..80cb4dc8 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -284,7 +284,7 @@ def delete_book(book_id, book_format, jsonResponse): return redirect(url_for('web.index')) -def render_edit_book(book_id, cover_edited): +def render_edit_book(book_id): calibre_db.update_title_sort(config) cc = calibre_db.session.query(db.Custom_Columns).filter(db.Custom_Columns.datatype.notin_(db.cc_exceptions)).all() book = calibre_db.get_filtered_book(book_id) @@ -307,7 +307,7 @@ def render_edit_book(book_id, cover_edited): kepub_possible=None if config.config_converterpath: for file in book.data: - if file.format.lower() in constants.EXTENSIONS_CONVERT_FROM: + if file.format.lower() in constants.EXTENSIONS_CONVERT: valid_source_formats.append(file.format.lower()) if config.config_kepubifypath and 'epub' in [file.format.lower() for file in book.data]: kepub_possible = True @@ -316,7 +316,7 @@ def render_edit_book(book_id, cover_edited): # Determine what formats don't already exist if config.config_converterpath: - allowed_conversion_formats = constants.EXTENSIONS_CONVERT_TO[:] + allowed_conversion_formats = constants.EXTENSIONS_CONVERT[:] for file in book.data: if file.format.lower() in allowed_conversion_formats: allowed_conversion_formats.remove(file.format.lower()) @@ -325,7 +325,7 @@ def render_edit_book(book_id, cover_edited): return render_title_template('book_edit.html', book=book, authors=author_names, cc=cc, title=_(u"edit metadata"), page="editbook", conversion_formats=allowed_conversion_formats, - config=config, cover_edit=cover_edited, + config=config, source_formats=valid_source_formats) @@ -582,10 +582,9 @@ def upload_cover(request, book): @edit_required def edit_book(book_id): modif_date = False - cover_edited = 0 # Show form if request.method != 'POST': - return render_edit_book(book_id, cover_edited) + return render_edit_book(book_id) # create the function for sorting... calibre_db.update_title_sort(config) @@ -600,7 +599,6 @@ def edit_book(book_id): if upload_cover(request, book) is True: book.has_cover = 1 modif_date = True - cover_edited = uuid4() try: to_save = request.form.to_dict() merge_metadata(to_save, meta) @@ -661,7 +659,6 @@ def edit_book(book_id): if result is True: book.has_cover = 1 modif_date = True - cover_edited = uuid4() else: flash(error, category="error") @@ -713,11 +710,11 @@ def edit_book(book_id): return redirect(url_for('web.show_book', book_id=book.id)) else: flash(_("Metadata successfully updated"), category="success") - return render_edit_book(book_id, cover_edited) + return render_edit_book(book_id) else: calibre_db.session.rollback() flash(error, category="error") - return render_edit_book(book_id, cover_edited) + return render_edit_book(book_id) except Exception as e: log.exception(e) calibre_db.session.rollback() diff --git a/cps/templates/book_edit.html b/cps/templates/book_edit.html index 38d2447d..16c02fae 100644 --- a/cps/templates/book_edit.html +++ b/cps/templates/book_edit.html @@ -3,7 +3,7 @@ {% if book %}
- {{ book.title }} + {{ book.title }}
{% if g.user.role_delete_books() %}