Merge branch 'master' into Develop

This commit is contained in:
Ozzieisaacs 2021-11-21 09:14:36 +01:00
commit 6deb527769
51 changed files with 86 additions and 62 deletions

View File

@ -31,7 +31,7 @@ If applicable, add screenshots to help explain your problem.
- OS: [e.g. Windows 10/Raspberry Pi OS] - OS: [e.g. Windows 10/Raspberry Pi OS]
- Python version: [e.g. python2.7] - Python version: [e.g. python2.7]
- Calibre-Web version: [e.g. 0.6.8 or 087c4c59 (git rev-parse --short HEAD)]: - Calibre-Web version: [e.g. 0.6.8 or 087c4c59 (git rev-parse --short HEAD)]:
- Docker container: [None/Technosoft2000/LinuxServer]: - Docker container: [None/LinuxServer]:
- Special Hardware: [e.g. Rasperry Pi Zero] - Special Hardware: [e.g. Rasperry Pi Zero]
- Browser: [e.g. Chrome 83.0.4103.97, Safari 13.3.7, Firefox 68.0.1 ESR] - Browser: [e.g. Chrome 83.0.4103.97, Safari 13.3.7, Firefox 68.0.1 ESR]

View File

@ -1348,7 +1348,9 @@ def _handle_new_user(to_save, content, languages, translations, kobo_support):
raise Exception(_(u"E-mail is not from valid domain")) raise Exception(_(u"E-mail is not from valid domain"))
except Exception as ex: except Exception as ex:
flash(str(ex), category="error") flash(str(ex), category="error")
return render_title_template("user_edit.html", new_user=1, content=content, translations=translations, return render_title_template("user_edit.html", new_user=1, content=content,
config=config,
translations=translations,
languages=languages, title=_(u"Add new user"), page="newuser", languages=languages, title=_(u"Add new user"), page="newuser",
kobo_support=kobo_support, registered_oauth=oauth_check) kobo_support=kobo_support, registered_oauth=oauth_check)
try: try:
@ -1463,6 +1465,7 @@ def _handle_edit_user(to_save, content, languages, translations, kobo_support):
kobo_support=kobo_support, kobo_support=kobo_support,
new_user=0, new_user=0,
content=content, content=content,
config=config,
registered_oauth=oauth_check, registered_oauth=oauth_check,
title=_(u"Edit User %(nick)s", nick=content.name), title=_(u"Edit User %(nick)s", nick=content.name),
page="edituser") page="edituser")
@ -1496,7 +1499,8 @@ def new_user():
content.sidebar_view = config.config_default_show content.sidebar_view = config.config_default_show
content.locale = config.config_default_locale content.locale = config.config_default_locale
content.default_language = config.config_default_language content.default_language = config.config_default_language
return render_title_template("user_edit.html", new_user=1, content=content, translations=translations, return render_title_template("user_edit.html", new_user=1, content=content,
config=config, translations=translations,
languages=languages, title=_(u"Add new user"), page="newuser", languages=languages, title=_(u"Add new user"), page="newuser",
kobo_support=kobo_support, registered_oauth=oauth_check) kobo_support=kobo_support, registered_oauth=oauth_check)
@ -1584,6 +1588,7 @@ def edit_user(user_id):
languages=languages, languages=languages,
new_user=0, new_user=0,
content=content, content=content,
config=config,
registered_oauth=oauth_check, registered_oauth=oauth_check,
mail_configured=config.get_mail_server_configured(), mail_configured=config.get_mail_server_configured(),
kobo_support=kobo_support, kobo_support=kobo_support,

View File

@ -63,7 +63,7 @@ log = logger.create()
try: try:
from wand.image import Image from wand.image import Image
from wand.exceptions import MissingDelegateError from wand.exceptions import MissingDelegateError, BlobError
use_IM = True use_IM = True
except (ImportError, RuntimeError) as e: except (ImportError, RuntimeError) as e:
log.debug('Cannot import Image, generating covers from non jpg files will not work: %s', e) log.debug('Cannot import Image, generating covers from non jpg files will not work: %s', e)
@ -697,13 +697,17 @@ def save_cover(img, book_path):
return False, _("Only jpg/jpeg/png/webp/bmp files are supported as coverfile") return False, _("Only jpg/jpeg/png/webp/bmp files are supported as coverfile")
# convert to jpg because calibre only supports jpg # convert to jpg because calibre only supports jpg
if content_type != 'image/jpg': if content_type != 'image/jpg':
if hasattr(img, 'stream'): try:
imgc = Image(blob=img.stream) if hasattr(img, 'stream'):
else: imgc = Image(blob=img.stream)
imgc = Image(blob=io.BytesIO(img.content)) else:
imgc.format = 'jpeg' imgc = Image(blob=io.BytesIO(img.content))
imgc.transform_colorspace("rgb") imgc.format = 'jpeg'
img = imgc imgc.transform_colorspace("rgb")
img = imgc
except BlobError:
log.error("Invalid cover file content")
return False, _("Invalid cover file content")
else: else:
if content_type not in 'image/jpeg': if content_type not in 'image/jpeg':
log.error("Only jpg/jpeg files are supported as coverfile") log.error("Only jpg/jpeg files are supported as coverfile")

View File

@ -17,6 +17,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from .iso_language_names import LANGUAGE_NAMES as _LANGUAGE_NAMES from .iso_language_names import LANGUAGE_NAMES as _LANGUAGE_NAMES
from . import logger
log = logger.create()
try: try:
@ -50,7 +53,10 @@ def get_language_names(locale):
def get_language_name(locale, lang_code): def get_language_name(locale, lang_code):
return get_language_names(locale)[lang_code] try:
return get_language_names(locale)[lang_code]
except KeyError:
log.error('Missing translation for language name: {}'.format(lang_code))
def get_language_codes(locale, language_names, remainder=None): def get_language_codes(locale, language_names, remainder=None):

View File

@ -79,6 +79,7 @@ LANGUAGE_NAMES = {
"cho": "choctawština", "cho": "choctawština",
"chp": "čipeva", "chp": "čipeva",
"chr": "čerokézština", "chr": "čerokézština",
"cht": "Cholón",
"chu": "Slavonic; Old", "chu": "Slavonic; Old",
"chv": "čuvaština", "chv": "čuvaština",
"chy": "čejenština", "chy": "čejenština",
@ -499,6 +500,7 @@ LANGUAGE_NAMES = {
"cho": "Choctaw", "cho": "Choctaw",
"chp": "Chipewyan", "chp": "Chipewyan",
"chr": "Cherokee", "chr": "Cherokee",
"cht": "Cholón",
"chu": "Altkirchenslawisch", "chu": "Altkirchenslawisch",
"chv": "Tschuwaschisch", "chv": "Tschuwaschisch",
"chy": "Cheyenne", "chy": "Cheyenne",
@ -916,6 +918,7 @@ LANGUAGE_NAMES = {
"chn": "Chinook jargon", "chn": "Chinook jargon",
"chp": "Chipewyan", "chp": "Chipewyan",
"cho": "Choctaw", "cho": "Choctaw",
"cht": "Cholón",
"chk": "Chuukese", "chk": "Chuukese",
"chv": "Chuvash", "chv": "Chuvash",
"cop": "Κοπτικά", "cop": "Κοπτικά",
@ -1294,6 +1297,7 @@ LANGUAGE_NAMES = {
"cho": "Choctaw", "cho": "Choctaw",
"chp": "Chipewyan", "chp": "Chipewyan",
"chr": "Cheroqui", "chr": "Cheroqui",
"cht": "Cholón",
"chu": "Eslavo antiguo", "chu": "Eslavo antiguo",
"chv": "Chuvasio", "chv": "Chuvasio",
"chy": "Cheyenne", "chy": "Cheyenne",
@ -1714,6 +1718,7 @@ LANGUAGE_NAMES = {
"cho": "choctaw", "cho": "choctaw",
"chp": "chipewyan", "chp": "chipewyan",
"chr": "cherokee", "chr": "cherokee",
"cht": "Cholón",
"chu": "Slavonic; Old", "chu": "Slavonic; Old",
"chv": "tšuvassi", "chv": "tšuvassi",
"chy": "cheyenne", "chy": "cheyenne",
@ -2134,6 +2139,7 @@ LANGUAGE_NAMES = {
"cho": "choctaw", "cho": "choctaw",
"chp": "chipewyan", "chp": "chipewyan",
"chr": "cherokee", "chr": "cherokee",
"cht": "cholón",
"chu": "slavon; ancien", "chu": "slavon; ancien",
"chv": "tchouvache", "chv": "tchouvache",
"chy": "cheyenne", "chy": "cheyenne",
@ -2554,6 +2560,7 @@ LANGUAGE_NAMES = {
"cho": "csoktó", "cho": "csoktó",
"chp": "csippeva", "chp": "csippeva",
"chr": "cserokí", "chr": "cserokí",
"cht": "Cholón",
"chu": "szláv; ószláv", "chu": "szláv; ószláv",
"chv": "csuvas", "chv": "csuvas",
"chy": "csejen", "chy": "csejen",
@ -2974,6 +2981,7 @@ LANGUAGE_NAMES = {
"cho": "Choctaw", "cho": "Choctaw",
"chp": "Chipewyan", "chp": "Chipewyan",
"chr": "Cherokee", "chr": "Cherokee",
"cht": "Cholón",
"chu": "Slavo antico", "chu": "Slavo antico",
"chv": "Chuvash", "chv": "Chuvash",
"chy": "Cheyenne", "chy": "Cheyenne",
@ -3394,6 +3402,7 @@ LANGUAGE_NAMES = {
"cho": "チョクトー語", "cho": "チョクトー語",
"chp": "チペワイアン語", "chp": "チペワイアン語",
"chr": "チェロキー語", "chr": "チェロキー語",
"cht": "Cholón",
"chu": "Slavonic; Old", "chu": "Slavonic; Old",
"chv": "チュヴァシュ語", "chv": "チュヴァシュ語",
"chy": "シャイアン語", "chy": "シャイアン語",
@ -3814,6 +3823,7 @@ LANGUAGE_NAMES = {
"cho": "Choctaw", "cho": "Choctaw",
"chp": "Chipewyan", "chp": "Chipewyan",
"chr": "Cherokee", "chr": "Cherokee",
"cht": "Cholón",
"chu": "Slavonic; Old", "chu": "Slavonic; Old",
"chv": "Chuvash", "chv": "Chuvash",
"chy": "Cheyenne", "chy": "Cheyenne",
@ -4234,6 +4244,7 @@ LANGUAGE_NAMES = {
"cho": "Choctaw", "cho": "Choctaw",
"chp": "Chipewyaans", "chp": "Chipewyaans",
"chr": "Cherokee", "chr": "Cherokee",
"cht": "Cholón",
"chu": "Slavisch; oud (kerk)", "chu": "Slavisch; oud (kerk)",
"chv": "Tsjoevasjisch", "chv": "Tsjoevasjisch",
"chy": "Cheyenne", "chy": "Cheyenne",
@ -4654,6 +4665,7 @@ LANGUAGE_NAMES = {
"cho": "czoktaw", "cho": "czoktaw",
"chp": "chipewyan", "chp": "chipewyan",
"chr": "czerokeski", "chr": "czerokeski",
"cht": "Cholón",
"chu": "starosłowiański", "chu": "starosłowiański",
"chv": "czuwaski", "chv": "czuwaski",
"chy": "czejeński", "chy": "czejeński",
@ -5071,6 +5083,7 @@ LANGUAGE_NAMES = {
"chn": "Chinook jargon", "chn": "Chinook jargon",
"chp": "Chipewyan", "chp": "Chipewyan",
"cho": "Choctaw", "cho": "Choctaw",
"cht": "Cholón",
"chk": "Chuukese", "chk": "Chuukese",
"chv": "Chuvash", "chv": "Chuvash",
"cop": "Coptic", "cop": "Coptic",
@ -5447,6 +5460,7 @@ LANGUAGE_NAMES = {
"cho": "Чоктав", "cho": "Чоктав",
"chp": "Чипевианский", "chp": "Чипевианский",
"chr": "Чероки", "chr": "Чероки",
"cht": "Cholón",
"chu": "Slavonic; Old", "chu": "Slavonic; Old",
"chv": "Чувашский", "chv": "Чувашский",
"chy": "Чейенн", "chy": "Чейенн",
@ -5867,6 +5881,7 @@ LANGUAGE_NAMES = {
"cho": "Choctaw", "cho": "Choctaw",
"chp": "Chopi", "chp": "Chopi",
"chr": "Cherokesiska", "chr": "Cherokesiska",
"cht": "Cholón",
"chu": "Slavonic; antik", "chu": "Slavonic; antik",
"chv": "Tjuvasjiska", "chv": "Tjuvasjiska",
"chy": "Cheyenne", "chy": "Cheyenne",
@ -6284,6 +6299,7 @@ LANGUAGE_NAMES = {
"chn": "Chinook lehçesi (Kuzey Batı Amerika kıyıları)", "chn": "Chinook lehçesi (Kuzey Batı Amerika kıyıları)",
"chp": "Chipewyan (Kuzey Amerika yerlileri)", "chp": "Chipewyan (Kuzey Amerika yerlileri)",
"cho": "Choctaw (Kuzey Amerika yerlileri)", "cho": "Choctaw (Kuzey Amerika yerlileri)",
"cht": "Cholón",
"chk": "Chuukese", "chk": "Chuukese",
"chv": "Çuvaş (Türkçe)", "chv": "Çuvaş (Türkçe)",
"cop": "Kıptice (Eski Mısır)", "cop": "Kıptice (Eski Mısır)",
@ -6660,6 +6676,7 @@ LANGUAGE_NAMES = {
"cho": "чоктау", "cho": "чоктау",
"chp": "чипев’ян", "chp": "чипев’ян",
"chr": "черокі", "chr": "черокі",
"cht": "чолон",
"chu": "давньослов’янська", "chu": "давньослов’янська",
"chv": "чуваська", "chv": "чуваська",
"chy": "шаєнн", "chy": "шаєнн",
@ -7080,6 +7097,7 @@ LANGUAGE_NAMES = {
"cho": "乔克托语", "cho": "乔克托语",
"chp": "奇佩维安语", "chp": "奇佩维安语",
"chr": "切罗基语", "chr": "切罗基语",
"cht": "Cholón",
"chu": "斯拉夫语(古教会)", "chu": "斯拉夫语(古教会)",
"chv": "楚瓦什语", "chv": "楚瓦什语",
"chy": "夏延语", "chy": "夏延语",
@ -7497,6 +7515,7 @@ LANGUAGE_NAMES = {
"chn": "Chinook jargon", "chn": "Chinook jargon",
"chp": "Chipewyan", "chp": "Chipewyan",
"cho": "Choctaw", "cho": "Choctaw",
"cht": "Cholón",
"chk": "Chuukese", "chk": "Chuukese",
"chv": "Chuvash", "chv": "Chuvash",
"cop": "Coptic", "cop": "Coptic",
@ -7873,6 +7892,7 @@ LANGUAGE_NAMES = {
"cho": "Choctaw", "cho": "Choctaw",
"chp": "Chipewyan", "chp": "Chipewyan",
"chr": "Cherokee", "chr": "Cherokee",
"cht": "Cholón",
"chu": "Slavonic; Old", "chu": "Slavonic; Old",
"chv": "Chuvash", "chv": "Chuvash",
"chy": "Cheyenne", "chy": "Cheyenne",

View File

@ -122,8 +122,8 @@ def search_to_shelf(shelf_id):
return redirect(url_for('web.index')) return redirect(url_for('web.index'))
if not check_shelf_edit_permissions(shelf): if not check_shelf_edit_permissions(shelf):
log.warning("You are not allowed to add a book to the the shelf: {}".format(shelf.name)) log.warning("You are not allowed to add a book to the shelf".format(shelf.name))
flash(_(u"You are not allowed to add a book to the the shelf: %(name)s", name=shelf.name), category="error") flash(_(u"You are not allowed to add a book to the shelf"), category="error")
return redirect(url_for('web.index')) return redirect(url_for('web.index'))
if current_user.id in ub.searched_ids and ub.searched_ids[current_user.id]: if current_user.id in ub.searched_ids and ub.searched_ids[current_user.id]:
@ -215,17 +215,22 @@ def remove_from_shelf(shelf_id, book_id):
else: else:
if not xhr: if not xhr:
log.warning("You are not allowed to remove a book from shelf: {}".format(shelf.name)) log.warning("You are not allowed to remove a book from shelf: {}".format(shelf.name))
flash(_(u"Sorry you are not allowed to remove a book from this shelf: %(sname)s", sname=shelf.name), flash(_(u"Sorry you are not allowed to remove a book from this shelf"),
category="error") category="error")
return redirect(url_for('web.index')) return redirect(url_for('web.index'))
return "Sorry you are not allowed to remove a book from this shelf: %s" % shelf.name, 403 return "Sorry you are not allowed to remove a book from this shelf", 403
@shelf.route("/shelf/create", methods=["GET", "POST"]) @shelf.route("/shelf/create", methods=["GET", "POST"])
@login_required @login_required
def create_shelf(): def create_shelf():
shelf = ub.Shelf() if not current_user.role_edit_shelfs() and request.method == 'POST':
return create_edit_shelf(shelf, page_title=_(u"Create a Shelf"), page="shelfcreate") flash(_(u"Sorry you are not allowed to create a public shelf"), category="error")
return redirect(url_for('web.index'))
else:
shelf = ub.Shelf()
return create_edit_shelf(shelf, page_title=_(u"Create a Shelf"), page="shelfcreate")
@shelf.route("/shelf/edit/<int:shelf_id>", methods=["GET", "POST"]) @shelf.route("/shelf/edit/<int:shelf_id>", methods=["GET", "POST"])

View File

@ -248,7 +248,7 @@ $("#btn-upload-format").on("change", function () {
if (filename.substring(3, 11) === "fakepath") { if (filename.substring(3, 11) === "fakepath") {
filename = filename.substring(12); filename = filename.substring(12);
} // Remove c:\fake at beginning from localhost chrome } // Remove c:\fake at beginning from localhost chrome
$("#upload-format").html(filename); $("#upload-format").text(filename);
}); });
$("#btn-upload-cover").on("change", function () { $("#btn-upload-cover").on("change", function () {
@ -256,7 +256,7 @@ $("#btn-upload-cover").on("change", function () {
if (filename.substring(3, 11) === "fakepath") { if (filename.substring(3, 11) === "fakepath") {
filename = filename.substring(12); filename = filename.substring(12);
} // Remove c:\fake at beginning from localhost chrome } // Remove c:\fake at beginning from localhost chrome
$("#upload-cover").html(filename); $("#upload-cover").text(filename);
}); });
$("#xchange").click(function () { $("#xchange").click(function () {

View File

@ -16,7 +16,7 @@
<th>{{_('Downloads')}}</th> <th>{{_('Downloads')}}</th>
<th class="hidden-xs ">{{_('Admin')}}</th> <th class="hidden-xs ">{{_('Admin')}}</th>
<th class="hidden-xs hidden-sm">{{_('Password')}}</th> <th class="hidden-xs hidden-sm">{{_('Password')}}</th>
{% if config.config_upload %} {% if config.config_uploading %}
<th class="hidden-xs hidden-sm">{{_('Upload')}}</th> <th class="hidden-xs hidden-sm">{{_('Upload')}}</th>
{% endif %} {% endif %}
<th class="hidden-xs hidden-sm">{{_('Download')}}</th> <th class="hidden-xs hidden-sm">{{_('Download')}}</th>
@ -34,7 +34,7 @@
<td>{{user.downloads.count()}}</td> <td>{{user.downloads.count()}}</td>
<td class="hidden-xs">{{ display_bool_setting(user.role_admin()) }}</td> <td class="hidden-xs">{{ display_bool_setting(user.role_admin()) }}</td>
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_passwd()) }}</td> <td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_passwd()) }}</td>
{% if config.config_upload %} {% if config.config_uploading %}
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_upload()) }}</td> <td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_upload()) }}</td>
{% endif %} {% endif %}
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_download()) }}</td> <td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_download()) }}</td>

View File

@ -95,7 +95,7 @@
<input type="checkbox" name="viewer_role" id="viewer_role" {% if conf.role_viewer() %}checked{% endif %}> <input type="checkbox" name="viewer_role" id="viewer_role" {% if conf.role_viewer() %}checked{% endif %}>
<label for="viewer_role">{{_('Allow eBook Viewer')}}</label> <label for="viewer_role">{{_('Allow eBook Viewer')}}</label>
</div> </div>
{% if config.config_upload %} {% if conf.config_uploading %}
<div class="form-group"> <div class="form-group">
<input type="checkbox" name="upload_role" id="upload_role" {% if conf.role_upload() %}checked{% endif %}> <input type="checkbox" name="upload_role" id="upload_role" {% if conf.role_upload() %}checked{% endif %}>
<label for="upload_role">{{_('Allow Uploads')}}</label> <label for="upload_role">{{_('Allow Uploads')}}</label>

View File

@ -101,7 +101,7 @@
<input type="checkbox" name="viewer_role" id="viewer_role" {% if content.role_viewer() %}checked{% endif %}> <input type="checkbox" name="viewer_role" id="viewer_role" {% if content.role_viewer() %}checked{% endif %}>
<label for="viewer_role">{{_('Allow eBook Viewer')}}</label> <label for="viewer_role">{{_('Allow eBook Viewer')}}</label>
</div> </div>
{% if config.config_upload %} {% if config.config_uploading %}
<div class="form-group"> <div class="form-group">
<input type="checkbox" name="upload_role" id="upload_role" {% if content.role_upload() %}checked{% endif %}> <input type="checkbox" name="upload_role" id="upload_role" {% if content.role_upload() %}checked{% endif %}>
<label for="upload_role">{{_('Allow Uploads')}}</label> <label for="upload_role">{{_('Allow Uploads')}}</label>

View File

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2020-06-09 21:11+0100\n" "PO-Revision-Date: 2020-06-09 21:11+0100\n"
"Last-Translator: Lukas Heroudek <lukas.heroudek@gmail.com>\n" "Last-Translator: Lukas Heroudek <lukas.heroudek@gmail.com>\n"
"Language: cs_CZ\n" "Language: cs_CZ\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2021-08-01 17:24+0200\n" "PO-Revision-Date: 2021-08-01 17:24+0200\n"
"Last-Translator: Ozzie Isaacs\n" "Last-Translator: Ozzie Isaacs\n"
"Language: de\n" "Language: de\n"

View File

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Depountis Georgios\n" "Last-Translator: Depountis Georgios\n"
"Language: el\n" "Language: el\n"

View File

@ -9,7 +9,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2020-05-25 17:22+0200\n" "PO-Revision-Date: 2020-05-25 17:22+0200\n"
"Last-Translator: minakmostoles <xxx@xxx.com>\n" "Last-Translator: minakmostoles <xxx@xxx.com>\n"
"Language: es\n" "Language: es\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2020-01-12 13:56+0100\n" "PO-Revision-Date: 2020-01-12 13:56+0100\n"
"Last-Translator: Samuli Valavuo <svalavuo@gmail.com>\n" "Last-Translator: Samuli Valavuo <svalavuo@gmail.com>\n"
"Language: fi\n" "Language: fi\n"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2020-06-07 06:47+0200\n" "PO-Revision-Date: 2020-06-07 06:47+0200\n"
"Last-Translator: <thovi98@gmail.com>\n" "Last-Translator: <thovi98@gmail.com>\n"
"Language: fr\n" "Language: fr\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2019-04-06 23:36+0200\n" "PO-Revision-Date: 2019-04-06 23:36+0200\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language: hu\n" "Language: hu\n"

View File

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2017-04-04 15:09+0200\n" "PO-Revision-Date: 2017-04-04 15:09+0200\n"
"Last-Translator: ElQuimm <quimm@webtaste.com>\n" "Last-Translator: ElQuimm <quimm@webtaste.com>\n"
"Language: it\n" "Language: it\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2018-02-07 02:20-0500\n" "PO-Revision-Date: 2018-02-07 02:20-0500\n"
"Last-Translator: white <space_white@yahoo.com>\n" "Last-Translator: white <space_white@yahoo.com>\n"
"Language: ja\n" "Language: ja\n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2018-08-27 17:06+0700\n" "PO-Revision-Date: 2018-08-27 17:06+0700\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language: km_KH\n" "Language: km_KH\n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web (GPLV3)\n" "Project-Id-Version: Calibre-Web (GPLV3)\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2020-12-12 08:20+0100\n" "PO-Revision-Date: 2020-12-12 08:20+0100\n"
"Last-Translator: Marcel Maas <marcel.maas@outlook.com>\n" "Last-Translator: Marcel Maas <marcel.maas@outlook.com>\n"
"Language: nl\n" "Language: nl\n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre Web - polski (POT: 2021-06-12 08:52)\n" "Project-Id-Version: Calibre Web - polski (POT: 2021-06-12 08:52)\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2021-06-12 15:35+0200\n" "PO-Revision-Date: 2021-06-12 15:35+0200\n"
"Last-Translator: Radosław Kierznowski <radek.kierznowski@outlook.com>\n" "Last-Translator: Radosław Kierznowski <radek.kierznowski@outlook.com>\n"
"Language: pl\n" "Language: pl\n"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: br\n" "Language: br\n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2020-04-29 01:20+0400\n" "PO-Revision-Date: 2020-04-29 01:20+0400\n"
"Last-Translator: ZIZA\n" "Last-Translator: ZIZA\n"
"Language: ru\n" "Language: ru\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2021-05-13 11:00+0000\n" "PO-Revision-Date: 2021-05-13 11:00+0000\n"
"Last-Translator: Jonatan Nyberg <jonatan.nyberg.karl@gmail.com>\n" "Last-Translator: Jonatan Nyberg <jonatan.nyberg.karl@gmail.com>\n"
"Language: sv\n" "Language: sv\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2020-04-23 22:47+0300\n" "PO-Revision-Date: 2020-04-23 22:47+0300\n"
"Last-Translator: iz <iz7iz7iz@protonmail.ch>\n" "Last-Translator: iz <iz7iz7iz@protonmail.ch>\n"
"Language: tr\n" "Language: tr\n"

View File

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-web\n" "Project-Id-Version: Calibre-web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/calibre-web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/calibre-web\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2017-04-30 00:47+0300\n" "PO-Revision-Date: 2017-04-30 00:47+0300\n"
"Last-Translator: ABIS Team <biblio.if.abis@gmail.com>\n" "Last-Translator: ABIS Team <biblio.if.abis@gmail.com>\n"
"Language: uk\n" "Language: uk\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2020-09-27 22:18+0800\n" "PO-Revision-Date: 2020-09-27 22:18+0800\n"
"Last-Translator: xlivevil <xlivevil@aliyun.com>\n" "Last-Translator: xlivevil <xlivevil@aliyun.com>\n"
"Language: zh_CN\n" "Language: zh_CN\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: 2020-09-27 22:18+0800\n" "PO-Revision-Date: 2020-09-27 22:18+0800\n"
"Last-Translator: xlivevil <xlivevil@aliyun.com>\n" "Last-Translator: xlivevil <xlivevil@aliyun.com>\n"
"Language: zh_TW\n" "Language: zh_TW\n"

View File

@ -62,22 +62,6 @@ searched_ids = {}
logged_in = dict() logged_in = dict()
def store_user_session():
if flask_session.get('_user_id', ""):
if logged_in.get(flask_session.get('_user_id', "")):
logged_in[flask_session.get('_user_id', "")].append(flask_session.get('_id', ""))
else:
logged_in[flask_session.get('_user_id', "")] = [flask_session.get('_id', "")]
log.info(flask_session.get('_id', ""))
def delete_user_session(user_id, session_key):
try:
logged_in.get(str(user_id), []).remove(session_key)
except ValueError:
pass
def check_user_session(user_id, session_key):
return session_key in logged_in.get(str(user_id), [])
def signal_store_user_session(object, user): def signal_store_user_session(object, user):
store_user_session() store_user_session()

View File

@ -339,7 +339,7 @@ def get_matching_tags():
def get_sort_function(sort, data): def get_sort_function(sort, data):
order = [db.Books.sort] order = [db.Books.timestamp.desc()]
if sort == 'stored': if sort == 'stored':
sort = current_user.get_view_property(data, 'stored') sort = current_user.get_view_property(data, 'stored')
else: else:
@ -369,7 +369,7 @@ def get_sort_function(sort, data):
if sort == 'hotasc': if sort == 'hotasc':
order = [func.count(ub.Downloads.book_id).asc()] order = [func.count(ub.Downloads.book_id).asc()]
if sort is None: if sort is None:
sort = "abc" sort = "new"
return order, sort return order, sort

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-10-30 16:37+0200\n" "POT-Creation-Date: 2021-11-20 11:24+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"