mirror of
https://github.com/janeczku/calibre-web
synced 2025-10-28 22:07:41 +00:00
Merge branch 'master' into development
# Conflicts: # cps/static/css/libs/bootstrap-table.min.css # cps/static/js/libs/bootstrap-table/bootstrap-table-editable.min.js # cps/static/js/libs/bootstrap-table/bootstrap-table.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-af-ZA.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ar-SA.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-bg-BG.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ca-ES.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-cs-CZ.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-da-DK.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-de-DE.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-el-GR.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-en-US.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-AR.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-CL.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-CR.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-ES.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-MX.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-NI.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-es-SP.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-et-EE.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-eu-EU.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fa-IR.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fi-FI.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fr-BE.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fr-CH.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fr-FR.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-fr-LU.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-he-IL.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-hr-HR.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-hu-HU.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-id-ID.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-it-IT.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ja-JP.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ka-GE.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ko-KR.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ms-MY.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-nb-NO.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-nl-BE.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-nl-NL.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-pl-PL.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-pt-BR.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-pt-PT.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ro-RO.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ru-RU.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-sk-SK.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-sr-Cyrl-RS.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-sr-Latn-RS.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-sv-SE.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-th-TH.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-tr-TR.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-uk-UA.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-ur-PK.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-vi-VN.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js # cps/static/js/libs/bootstrap-table/locale/bootstrap-table-zh-TW.min.js
This commit is contained in:
@@ -1045,24 +1045,41 @@ def convert_bookformat(book_id):
|
||||
def edit_list_book(param):
|
||||
vals = request.form.to_dict()
|
||||
book = calibre_db.get_book(vals['pk'])
|
||||
ret = ""
|
||||
if param =='series_index':
|
||||
edit_book_series_index(vals['value'], book)
|
||||
ret = Response(json.dumps({'success':True, 'newValue': book.series_index}), mimetype='application/json')
|
||||
elif param =='tags':
|
||||
edit_book_tags(vals['value'], book)
|
||||
ret = Response(json.dumps({'success':True, 'newValue': ', '.join([tag.name for tag in book.tags])}),
|
||||
mimetype='application/json')
|
||||
elif param =='series':
|
||||
edit_book_series(vals['value'], book)
|
||||
ret = Response(json.dumps({'success':True, 'newValue': ', '.join([serie.name for serie in book.series])}),
|
||||
mimetype='application/json')
|
||||
elif param =='publishers':
|
||||
vals['publisher'] = vals['value']
|
||||
edit_book_publisher(vals, book)
|
||||
ret = Response(json.dumps({'success':True, 'newValue': book.publishers}),
|
||||
mimetype='application/json')
|
||||
elif param =='languages':
|
||||
edit_book_languages(vals['value'], book)
|
||||
# ToDo: Not working
|
||||
ret = Response(json.dumps({'success':True, 'newValue': ', '.join([lang.name for lang in book.languages])}),
|
||||
mimetype='application/json')
|
||||
elif param =='author_sort':
|
||||
book.author_sort = vals['value']
|
||||
ret = Response(json.dumps({'success':True, 'newValue': book.author_sort}),
|
||||
mimetype='application/json')
|
||||
elif param =='title':
|
||||
book.title = vals['value']
|
||||
helper.update_dir_stucture(book.id, config.config_calibre_dir)
|
||||
ret = Response(json.dumps({'success':True, 'newValue': book.title}),
|
||||
mimetype='application/json')
|
||||
elif param =='sort':
|
||||
book.sort = vals['value']
|
||||
ret = Response(json.dumps({'success':True, 'newValue': book.sort}),
|
||||
mimetype='application/json')
|
||||
# ToDo: edit books
|
||||
elif param =='authors':
|
||||
input_authors = vals['value'].split('&')
|
||||
@@ -1080,9 +1097,11 @@ def edit_list_book(param):
|
||||
if book.author_sort != sort_authors:
|
||||
book.author_sort = sort_authors
|
||||
helper.update_dir_stucture(book.id, config.config_calibre_dir, input_authors[0])
|
||||
ret = Response(json.dumps({'success':True, 'newValue': ', '.join([author.name for author in book.authors])}),
|
||||
mimetype='application/json')
|
||||
book.last_modified = datetime.utcnow()
|
||||
calibre_db.session.commit()
|
||||
return ""
|
||||
return ret
|
||||
|
||||
@editbook.route("/ajax/sort_value/<field>/<int:bookid>")
|
||||
@login_required
|
||||
|
||||
Reference in New Issue
Block a user