Commit 50ba2e32 authored by Ozzieisaacs's avatar Ozzieisaacs

Merge branch 'master' into Develop

# Conflicts:
#	cps/shelf.py
parents 5255085d c1e2a98f
......@@ -30,7 +30,7 @@ Calibre-Web is a web app providing a clean interface for browsing, reading and d
## Quick start
1. Install dependencies by running `pip3 install --target vendor -r requirements.txt`.
1. Install dependencies by running `pip3 install --target vendor -r requirements.txt` (python3.x) or `pip install --target vendor -r requirements.txt` (python2.7).
2. Execute the command: `python cps.py` (or `nohup python cps.py` - recommended if you want to exit the terminal window)
3. Point your browser to `http://localhost:8083` or `http://localhost:8083/opds` for the OPDS catalog
4. Set `Location of Calibre database` to the path of the folder where your Calibre library (metadata.db) lives, push "submit" button\
......
......@@ -50,7 +50,7 @@ def oauth_required(f):
def inner(*args, **kwargs):
if config.config_login_type == constants.LOGIN_OAUTH:
return f(*args, **kwargs)
if request.is_xhr:
if request.headers.get('X-Requested-With') == 'XMLHttpRequest':
data = {'status': 'error', 'message': 'Not Found'}
response = make_response(json.dumps(data, ensure_ascii=False))
response.headers["Content-Type"] = "application/json; charset=utf-8"
......
......@@ -146,7 +146,7 @@ class WebServer(object):
self.unix_socket_file = None
def _start_tornado(self):
if os.name == 'nt':
if os.name == 'nt' and sys.version_info > (3, 7):
import asyncio
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
log.info('Starting Tornado server on %s', _readable_listen_address(self.listen_address, self.listen_port))
......
......@@ -40,17 +40,18 @@ log = logger.create()
@shelf.route("/shelf/add/<int:shelf_id>/<int:book_id>")
@login_required
def add_to_shelf(shelf_id, book_id):
xhr = request.headers.get('X-Requested-With') == 'XMLHttpRequest'
shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first()
if shelf is None:
log.error("Invalid shelf specified: %s", shelf_id)
if not request.is_xhr:
if not xhr:
flash(_(u"Invalid shelf specified"), category="error")
return redirect(url_for('web.index'))
return "Invalid shelf specified", 400
if not shelf.is_public and not shelf.user_id == int(current_user.id):
log.error("User %s not allowed to add a book to %s", current_user, shelf)
if not request.is_xhr:
if not xhr:
flash(_(u"Sorry you are not allowed to add a book to the the shelf: %(shelfname)s", shelfname=shelf.name),
category="error")
return redirect(url_for('web.index'))
......@@ -58,7 +59,7 @@ def add_to_shelf(shelf_id, book_id):
if shelf.is_public and not current_user.role_edit_shelfs():
log.info("User %s not allowed to edit public shelves", current_user)
if not request.is_xhr:
if not xhr:
flash(_(u"You are not allowed to edit public shelves"), category="error")
return redirect(url_for('web.index'))
return "User is not allowed to edit public shelves", 403
......@@ -67,7 +68,7 @@ def add_to_shelf(shelf_id, book_id):
ub.BookShelf.book_id == book_id).first()
if book_in_shelf:
log.error("Book %s is already part of %s", book_id, shelf)
if not request.is_xhr:
if not xhr:
flash(_(u"Book is already part of the shelf: %(shelfname)s", shelfname=shelf.name), category="error")
return redirect(url_for('web.index'))
return "Book is already part of the shelf: %s" % shelf.name, 400
......@@ -81,7 +82,7 @@ def add_to_shelf(shelf_id, book_id):
ins = ub.BookShelf(shelf=shelf.id, book_id=book_id, order=maxOrder + 1)
ub.session.add(ins)
ub.session.commit()
if not request.is_xhr:
if not xhr:
flash(_(u"Book has been added to shelf: %(sname)s", sname=shelf.name), category="success")
if "HTTP_REFERER" in request.environ:
return redirect(request.environ["HTTP_REFERER"])
......@@ -147,10 +148,11 @@ def search_to_shelf(shelf_id):
@shelf.route("/shelf/remove/<int:shelf_id>/<int:book_id>")
@login_required
def remove_from_shelf(shelf_id, book_id):
xhr = request.headers.get('X-Requested-With') == 'XMLHttpRequest'
shelf = ub.session.query(ub.Shelf).filter(ub.Shelf.id == shelf_id).first()
if shelf is None:
log.error("Invalid shelf specified: %s", shelf_id)
if not request.is_xhr:
if not xhr:
return redirect(url_for('web.index'))
return "Invalid shelf specified", 400
......@@ -169,20 +171,20 @@ def remove_from_shelf(shelf_id, book_id):
if book_shelf is None:
log.error("Book %s already removed from %s", book_id, shelf)
if not request.is_xhr:
if not xhr:
return redirect(url_for('web.index'))
return "Book already removed from shelf", 410
ub.session.delete(book_shelf)
ub.session.commit()
if not request.is_xhr:
if not xhr:
flash(_(u"Book has been removed from shelf: %(sname)s", sname=shelf.name), category="success")
return redirect(request.environ["HTTP_REFERER"])
return "", 204
else:
log.error("User %s not allowed to remove a book from %s", current_user, shelf)
if not request.is_xhr:
if not xhr:
flash(_(u"Sorry you are not allowed to remove a book from this shelf: %(sname)s", sname=shelf.name),
category="error")
return redirect(url_for('web.index'))
......@@ -284,8 +286,14 @@ def show_shelf(shelf_type, shelf_id):
books_in_shelf = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id)\
.order_by(ub.BookShelf.order.asc()).all()
books_list = [ b.book_id for b in books_in_shelf]
result = db.session.query(db.Books).filter(db.Books.id.in_(books_list)).filter(common_filters()).all()
for book in books_in_shelf:
cur_book = db.session.query(db.Books).filter(db.Books.id == book.book_id).filter(common_filters()).first()
if cur_book:
result.append(cur_book)
else:
log.info('Not existing book %s in %s deleted', book.book_id, shelf)
ub.session.query(ub.BookShelf).filter(ub.BookShelf.book_id == book.book_id).delete()
ub.session.commit()
return render_title_template(page, entries=result, title=_(u"Shelf: '%(name)s'", name=shelf.name),
shelf=shelf, page="shelf")
else:
......@@ -315,11 +323,13 @@ def order_shelf(shelf_id):
ub.Shelf.id == shelf_id))).first()
result = list()
if shelf:
books_in_shelf = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id) \
books_in_shelf2 = ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id) \
.order_by(ub.BookShelf.order.asc()).all()
books_list = [ b.book_id for b in books_in_shelf]
# cover, title, series, name, all author names,
result = db.session.query(db.Books).filter(db.Books.id.in_(books_list)).filter(common_filters()).all()
for book in books_in_shelf2:
cur_book = db.session.query(db.Books).filter(db.Books.id == book.book_id).filter(common_filters()).first()
result.append(cur_book)
#books_list = [ b.book_id for b in books_in_shelf2]
#result = db.session.query(db.Books).filter(db.Books.id.in_(books_list)).filter(common_filters()).all()
return render_title_template('shelf_order.html', entries=result,
title=_(u"Change order of Shelf: '%(name)s'", name=shelf.name),
shelf=shelf, page="shelforder")
......@@ -19,7 +19,7 @@
* Google Books api document: https://developers.google.com/books/docs/v1/using
* Douban Books api document: https://developers.douban.com/wiki/?title=book_v2 (Chinese Only)
*/
/* global _, i18nMsg, tinymce */
/* global _, i18nMsg, tinymce */
var dbResults = [];
var ggResults = [];
......@@ -55,9 +55,9 @@ $(function () {
$(".cover img").attr("src", book.cover);
$("#cover_url").val(book.cover);
$("#pubdate").val(book.publishedDate);
$("#publisher").val(book.publisher)
if (book.series != undefined) {
$("#series").val(book.series)
$("#publisher").val(book.publisher);
if (typeof book.series !== "undefined") {
$("#series").val(book.series);
}
}
......@@ -72,16 +72,18 @@ $(function () {
}
function formatDate (date) {
var d = new Date(date),
month = '' + (d.getMonth() + 1),
day = '' + d.getDate(),
month = "" + (d.getMonth() + 1),
day = "" + d.getDate(),
year = d.getFullYear();
if (month.length < 2)
month = '0' + month;
if (day.length < 2)
day = '0' + day;
return [year, month, day].join('-');
if (month.length < 2) {
month = "0" + month;
}
if (day.length < 2) {
day = "0" + day;
}
return [year, month, day].join("-");
}
if (ggDone && ggResults.length > 0) {
......@@ -116,16 +118,17 @@ $(function () {
}
if (dbDone && dbResults.length > 0) {
dbResults.forEach(function(result) {
if (result.series){
var series_title = result.series.title
var seriesTitle = "";
if (result.series) {
seriesTitle = result.series.title;
}
var date_fomers = result.pubdate.split("-")
var publishedYear = parseInt(date_fomers[0])
var publishedMonth = parseInt(date_fomers[1])
var publishedDate = new Date(publishedYear, publishedMonth-1, 1)
var dateFomers = result.pubdate.split("-");
var publishedYear = parseInt(dateFomers[0]);
var publishedMonth = parseInt(dateFomers[1]);
var publishedDate = new Date(publishedYear, publishedMonth - 1, 1);
publishedDate = formatDate(publishedDate);
publishedDate = formatDate(publishedDate)
var book = {
id: result.id,
title: result.title,
......@@ -137,7 +140,7 @@ $(function () {
return tag.title.toLowerCase().replace(/,/g, "_");
}),
rating: result.rating.average || 0,
series: series_title || "",
series: seriesTitle || "",
cover: result.image,
url: "https://book.douban.com/subject/" + result.id,
source: {
......@@ -183,7 +186,7 @@ $(function () {
}
function dbSearchBook (title) {
apikey="0df993c66c0c636e29ecbb5344252a4a"
var apikey = "0df993c66c0c636e29ecbb5344252a4a";
$.ajax({
url: douban + dbSearch + "?apikey=" + apikey + "&q=" + title + "&fields=all&count=10",
type: "GET",
......@@ -193,7 +196,7 @@ $(function () {
dbResults = data.books;
},
error: function error() {
$("#meta-info").html("<p class=\"text-danger\">" + msg.search_error + "!</p>"+ $("#meta-info")[0].innerHTML)
$("#meta-info").html("<p class=\"text-danger\">" + msg.search_error + "!</p>" + $("#meta-info")[0].innerHTML);
},
complete: function complete() {
dbDone = true;
......
This diff is collapsed.
......@@ -29,7 +29,7 @@ function sendData(path) {
var maxElements;
var tmp = [];
elements = Sortable.utils.find(sortTrue, "div");
elements = $(".list-group-item");
maxElements = elements.length;
var form = document.createElement("form");
......
......@@ -29,7 +29,7 @@
{% endfor %}
</div>
<button onclick="sendData('{{ url_for('shelf.order_shelf', shelf_id=shelf.id) }}')" class="btn btn-default" id="ChangeOrder">{{_('Change order')}}</button>
<a href="{{ url_for('shelf.show_shelf', shelf_id=shelf.id) }}" class="btn btn-default">{{_('Back')}}</a>
<a href="{{ url_for('shelf.show_shelf', shelf_id=shelf.id) }}" id="shelf_back" class="btn btn-default">{{_('Back')}}</a>
</div>
{% endblock %}
......
......@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2020-01-08 11:37+0000\n"
"Last-Translator: Lukas Heroudek <lukas.heroudek@gmail.com>\n"
"Language: cs_CZ\n"
......@@ -79,7 +79,7 @@ msgstr "Byl nalezen existující účet pro tuto e-mailovou adresu nebo přezdí
#: cps/admin.py:489
#, python-format
msgid "User '%(user)s' created"
msgstr "Uživatel ‘%(user)s’ vytvořen"
msgstr "Uživatel '%(user)s' vytvořen"
#: cps/admin.py:509
msgid "Edit e-mail server settings"
......@@ -205,7 +205,7 @@ msgstr "není nakonfigurováno"
#: cps/editbooks.py:214 cps/editbooks.py:396
msgid "Error opening eBook. File does not exist or file is not accessible"
msgstr "Chyba otevírání eKnihy. Soubor neexistuje nebo není přístupný"
msgstr "Chyba otevírání eknihy. Soubor neexistuje nebo není přístupný"
#: cps/editbooks.py:242
msgid "edit metadata"
......@@ -214,11 +214,11 @@ msgstr "upravit metadata"
#: cps/editbooks.py:321 cps/editbooks.py:569
#, python-format
msgid "File extension '%(ext)s' is not allowed to be uploaded to this server"
msgstr "Soubor s příponou ‘%(ext)s’ nelze odeslat na tento server"
msgstr "Soubor s příponou '%(ext)s' nelze odeslat na tento server"
#: cps/editbooks.py:325 cps/editbooks.py:573
msgid "File to be uploaded must have an extension"
msgstr "Soubor, který má být odeslán, musí mít příponu"
msgstr "Soubor, který má být odeslán musí mít příponu"
#: cps/editbooks.py:337 cps/editbooks.py:607
#, python-format
......@@ -296,7 +296,7 @@ msgstr "Při převodu této knihy došlo k chybě: %(res)s"
#: cps/gdrive.py:62
msgid "Google Drive setup not completed, try to deactivate and activate Google Drive again"
msgstr "Google Drive nastavení nebylo dokončeno, zkuste znovu deaktivovat a aktivovat Google Drive"
msgstr "Google Drive nastavení nebylo dokončeno, zkuste znovu deaktivovat a aktivovat Google Drive"
#: cps/gdrive.py:104
msgid "Callback domain is not verified, please follow steps to verify domain in google developer console"
......@@ -366,17 +366,17 @@ msgstr "Požadovaný soubor nelze přečíst. Možná nesprávná oprávnění?"
#: cps/helper.py:322
#, python-format
msgid "Rename title from: '%(src)s' to '%(dest)s' failed with error: %(error)s"
msgstr "Přejmenování názvu z: ‘%(src)s‘ na ‘%(dest)s' selhalo chybou: %(error)s"
msgstr "Přejmenování názvu z: '%(src)s' na '%(dest)s' selhalo chybou: %(error)s"
#: cps/helper.py:332
#, python-format
msgid "Rename author from: '%(src)s' to '%(dest)s' failed with error: %(error)s"
msgstr "Přejmenovat autora z: ‘%(src)s‘ na ‘%(dest)s’ selhalo chybou: %(error)s"
msgstr "Přejmenovat autora z: '%(src)s' na '%(dest)s' selhalo chybou: %(error)s"
#: cps/helper.py:346
#, python-format
msgid "Rename file in path '%(src)s' to '%(dest)s' failed with error: %(error)s"
msgstr "Přejmenování souboru v cestě ‘%(src)s‘ na ‘%(dest)s‘ selhalo chybou: %(error)s"
msgstr "Přejmenování souboru v cestě '%(src)s' na '%(dest)s' selhalo chybou: %(error)s"
#: cps/helper.py:372 cps/helper.py:382 cps/helper.py:390
#, python-format
......@@ -528,7 +528,7 @@ msgstr "Lituji, nejste oprávněni odebrat knihu z této police: %(sname)s"
#: cps/shelf.py:207 cps/shelf.py:231
#, python-format
msgid "A shelf with the name '%(title)s' already exists."
msgstr "Police s názvem ‘%(title)s’ již existuje."
msgstr "Police s názvem '%(title)s' již existuje."
#: cps/shelf.py:212
#, python-format
......@@ -555,7 +555,7 @@ msgstr "Upravit polici"
#: cps/shelf.py:289
#, python-format
msgid "Shelf: '%(name)s'"
msgstr "Police: ’%(name)s’"
msgstr "Police: '%(name)s'"
#: cps/shelf.py:292
msgid "Error opening shelf. Shelf does not exist or is not accessible"
......@@ -564,7 +564,7 @@ msgstr "Chyba otevírání police. Police neexistuje nebo není přístupná"
#: cps/shelf.py:323
#, python-format
msgid "Change order of Shelf: '%(name)s'"
msgstr "Změnit pořadí Police: ‘%(name)s’"
msgstr "Změnit pořadí Police: '%(name)s'"
#: cps/ub.py:57
msgid "Recently Added"
......@@ -858,7 +858,7 @@ msgstr "Nelze aktivovat ověření LDAP"
#: cps/web.py:1151 cps/web.py:1278
#, python-format
msgid "you are now logged in as: '%(nickname)s'"
msgstr "nyní jste přihlášeni jako: ‘%(nickname)s’"
msgstr "nyní jste přihlášeni jako: '%(nickname)s'"
#: cps/web.py:1156
msgid "Could not login. LDAP server down, please contact your administrator"
......@@ -1153,7 +1153,7 @@ msgstr "Převést formát knihy:"
#: cps/templates/book_edit.html:30
msgid "Convert from:"
msgstr "Převest z:"
msgstr "Převést z:"
#: cps/templates/book_edit.html:32 cps/templates/book_edit.html:39
msgid "select an option"
......@@ -1165,7 +1165,7 @@ msgstr "Převést do:"
#: cps/templates/book_edit.html:46
msgid "Convert book"
msgstr "Převest knihu"
msgstr "Převést knihu"
#: cps/templates/book_edit.html:55 cps/templates/search_form.html:6
msgid "Book Title"
......@@ -1341,7 +1341,7 @@ msgstr "Server port"
#: cps/templates/config_edit.html:91
msgid "SSL certfile location (leave it empty for non-SSL Servers)"
msgstr "Umístění certifikátu SSL (ponechejte prázdné u serverů jiných než SSL)"
msgstr "Umístění certifikátu SSL (ponechte prázdné pro servery jiné než SSL)"
#: cps/templates/config_edit.html:95
msgid "SSL Keyfile location (leave it empty for non-SSL Servers)"
......@@ -1405,7 +1405,7 @@ msgstr "Povolit veřejnou registraci"
#: cps/templates/config_edit.html:170
msgid "Enable remote login (\"magic link\")"
msgstr "Povolit vzdálené přihlášení (\\“magic link\\”)"
msgstr "Povolit vzdálené přihlášení (\\\"magic link\\\")"
#: cps/templates/config_edit.html:175
msgid "Use Goodreads"
......@@ -1495,12 +1495,12 @@ msgstr "Obtain %(provider)s OAuth Credential"
#: cps/templates/config_edit.html:263
#, python-format
msgid "%(provider)s OAuth Client Id"
msgstr "%(provider)s OAuth Client Id"
msgstr "%(provider)s OAuth Klient Id"
#: cps/templates/config_edit.html:267
#, python-format
msgid "%(provider)s OAuth Client Secret"
msgstr "%(provider)s OAuth Client Secret"
msgstr "%(provider)s OAuth Klient Tajemství"
#: cps/templates/config_edit.html:276
msgid "Allow Reverse Proxy Authentication"
......@@ -1532,7 +1532,7 @@ msgstr "Nastavení převaděče eknih"
#: cps/templates/config_edit.html:312
msgid "Path to convertertool"
msgstr "Cesta k převáděči"
msgstr "Cesta k převaděči"
#: cps/templates/config_edit.html:318
msgid "Location of Unrar binary"
......@@ -1577,7 +1577,7 @@ msgstr "Regulární výraz pro ignorování sloupců"
#: cps/templates/config_view_edit.html:46
msgid "Link read/unread status to Calibre column"
msgstr "Propojit stav čtení/nepřečtení do sloupce Calibre"
msgstr "Propojit stav čtení/nepřečtení do sloupce Calibre"
#: cps/templates/config_view_edit.html:55
msgid "Regular expression for title sorting"
......@@ -1625,7 +1625,7 @@ msgstr "Povolit úpravy veřejných polic"
#: cps/templates/config_view_edit.html:119
msgid "Default visibilities for new users"
msgstr "Výchozí viditelnosti pro nové uživatele"
msgstr "Výchozí zobrazení pro nové uživatele"
#: cps/templates/config_view_edit.html:135 cps/templates/user_edit.html:76
msgid "Show random books in detail view"
......@@ -2337,7 +2337,7 @@ msgstr "Nedávná stahování"
#~ msgstr "Prohlížeč PDF.js"
#~ msgid "Preparing document for printing..."
#~ msgstr "Příprava dokumentu pro tisk"
#~ msgstr "Příprava dokumentu pro tisk..."
#~ msgid "Using your another device, visit"
#~ msgstr "Pomocí jiného zařízení navštivte"
......@@ -3315,7 +3315,7 @@ msgstr "Nedávná stahování"
#~ msgstr "Selkup"
#~ msgid "Irish; Old (to 900)"
#~ msgstr "Irlandese antico (fino al 900)"
#~ msgstr "Irlandese antico (fino al 900)"
#~ msgid "Shan"
#~ msgstr "Shan"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2020-01-18 12:52+0100\n"
"Last-Translator: Ozzie Isaacs\n"
"Language: de\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2019-07-26 11:44+0100\n"
"Last-Translator: minakmostoles <xxx@xxx.com>\n"
"Language: es\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2020-01-12 13:56+0100\n"
"Last-Translator: Samuli Valavuo <svalavuo@gmail.com>\n"
"Language: fi\n"
......
......@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2019-08-21 15:20+0100\n"
"Last-Translator: Nicolas Roudninski <nicoroud@gmail.com>\n"
"Language: fr\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2019-04-06 23:36+0200\n"
"Last-Translator: \n"
"Language: hu\n"
......
This diff is collapsed.
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2018-02-07 02:20-0500\n"
"Last-Translator: white <space_white@yahoo.com>\n"
"Language: ja\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2018-08-27 17:06+0700\n"
"Last-Translator: \n"
"Language: km_KH\n"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web (GPLV3)\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2019-06-17 22:37+0200\n"
"Last-Translator: Marcel Maas <marcel.maas@outlook.com>\n"
"Language: nl\n"
......
This diff is collapsed.
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2020-01-21 23:03+0400\n"
"Last-Translator: ZIZA\n"
"Language: ru\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2020-01-18 11:22+0100\n"
"Last-Translator: Jonatan Nyberg <jonatan.nyberg.karl@gmail.com>\n"
"Language: sv\n"
......
......@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/calibre-web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2017-04-30 00:47+0300\n"
"Last-Translator: ABIS Team <biblio.if.abis@gmail.com>\n"
"Language: uk\n"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: 2017-01-06 17:00+0000\n"
"Last-Translator: dalin <dalin.lin@gmail.com>\n"
"Language: zh_Hans_CN\n"
......
......@@ -151,7 +151,7 @@ def load_user_from_auth_header(header_val):
header_val = base64.b64decode(header_val).decode('utf-8')
basic_username = header_val.split(':')[0]
basic_password = header_val.split(':')[1]
except TypeError:
except (TypeError, UnicodeDecodeError):
pass
user = _fetch_user_by_name(basic_username)
if user and check_password_hash(str(user.password), basic_password):
......@@ -173,7 +173,7 @@ def remote_login_required(f):
def inner(*args, **kwargs):
if config.config_remote_login:
return f(*args, **kwargs)
if request.is_xhr:
if request.headers.get('X-Requested-With') == 'XMLHttpRequest':
data = {'status': 'error', 'message': 'Forbidden'}
response = make_response(json.dumps(data, ensure_ascii=False))
response.headers["Content-Type"] = "application/json; charset=utf-8"
......@@ -1469,7 +1469,7 @@ def show_book(book_id):
audioentries.append(media_format.format.lower())
return render_title_template('detail.html', entry=entries, audioentries=audioentries, cc=cc,
is_xhr=request.is_xhr, title=entries.title, books_shelfs=book_in_shelfs,
is_xhr=request.headers.get('X-Requested-With')=='XMLHttpRequest', title=entries.title, books_shelfs=book_in_shelfs,
have_read=have_read, kindle_list=kindle_list, reader_list=reader_list, page="book")
else:
log.debug(u"Error opening eBook. File does not exist or file is not accessible:")
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2020-01-27 18:16+0100\n"
"POT-Creation-Date: 2020-02-01 15:02+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment