mirror of
https://github.com/janeczku/calibre-web
synced 2026-10-16 13:01:40 +00:00
Fixes after testrun
This commit is contained in:
+8
-3
@@ -138,9 +138,14 @@ try:
|
||||
response = gdriveutils.getChangeById(gdriveutils.Gdrive.Instance().drive, j['id'])
|
||||
log.debug('%r', response)
|
||||
if response:
|
||||
dbpath = os.path.join(config.config_calibre_dir, "metadata.db").encode()
|
||||
if not response['deleted'] and response['file']['title'] == 'metadata.db' \
|
||||
and response['file']['md5Checksum'] != hashlib.md5(dbpath).hexdigest(): # nosec
|
||||
dbpath = os.path.join(config.config_calibre_dir, "metadata.db")
|
||||
if response['deleted'] or response['file']['title'] != 'metadata.db':
|
||||
return ''
|
||||
checksum = hashlib.md5() # nosec
|
||||
with open(dbpath, 'rb') as database:
|
||||
for chunk in iter(lambda: database.read(65536), b''):
|
||||
checksum.update(chunk)
|
||||
if response['file']['md5Checksum'] != checksum.hexdigest():
|
||||
tmp_dir = get_temp_dir()
|
||||
|
||||
log.info('Database file updated')
|
||||
|
||||
@@ -138,7 +138,7 @@ $(function () {
|
||||
var initial = String(element.data("initial")) === "true";
|
||||
var val = element.prop('checked');
|
||||
var params = {id : id, value: val};
|
||||
$('[data-related="' + id + '"]').toggle(val);
|
||||
$('[data-related="' + id + '"]').toggleClass("d-none", !val);
|
||||
if (!initial) {
|
||||
params['initial'] = initial;
|
||||
params['query'] = keyword;
|
||||
|
||||
@@ -25,7 +25,7 @@ function syncTomSelects() {
|
||||
if (typeof TomSelect === "undefined") {
|
||||
return;
|
||||
}
|
||||
$(".multi_selector").each(function () {
|
||||
$("select.multi_selector").each(function () {
|
||||
if (!this.tomselect) {
|
||||
new TomSelect(this, {
|
||||
persist: false,
|
||||
@@ -44,7 +44,7 @@ function clearTomSelects() {
|
||||
if (typeof TomSelect === "undefined") {
|
||||
return;
|
||||
}
|
||||
$(".multi_selector").each(function () {
|
||||
$("select.multi_selector").each(function () {
|
||||
if (this.tomselect) {
|
||||
this.tomselect.clear();
|
||||
}
|
||||
@@ -971,9 +971,10 @@ function handle_header_buttons () {
|
||||
$(".button_head").addClass("disabled");
|
||||
$(".multi_head").attr("aria-disabled", true);
|
||||
$(".multi_head").addClass("hidden");
|
||||
$(".multi_selector").attr("aria-disabled", true);
|
||||
$(".multi_selector").attr("disabled", true);
|
||||
$("select.multi_selector").attr("aria-disabled", true);
|
||||
$("select.multi_selector").attr("disabled", true);
|
||||
$(".header_select").attr("disabled", true);
|
||||
syncTomSelects();
|
||||
} else {
|
||||
$(".mass_selection").removeClass("disabled");
|
||||
$(".mass_selection").attr("aria-disabled", false);
|
||||
@@ -983,8 +984,8 @@ function handle_header_buttons () {
|
||||
$(".button_head").removeClass("disabled");
|
||||
$(".multi_head").attr("aria-disabled", false);
|
||||
$(".multi_head").removeClass("hidden");
|
||||
$(".multi_selector").attr("aria-disabled", false);
|
||||
$(".multi_selector").removeAttr("disabled");
|
||||
$("select.multi_selector").attr("aria-disabled", false);
|
||||
$("select.multi_selector").removeAttr("disabled");
|
||||
$(".header_select").removeAttr("disabled");
|
||||
syncTomSelects();
|
||||
}
|
||||
|
||||
@@ -401,6 +401,18 @@
|
||||
<label for="config_password_min_length">{{_('Minimum password length')}}</label>
|
||||
<input type="number" min="1" max="40" class="form-control" name="config_password_min_length" id="config_password_min_length" value="{% if config.config_password_min_length != None %}{{ config.config_password_min_length }}{% endif %}" autocomplete="off" required>
|
||||
</div>
|
||||
{% for field, caption in [
|
||||
('config_password_number', _('Enforce number')),
|
||||
('config_password_lower', _('Enforce lowercase characters')),
|
||||
('config_password_upper', _('Enforce uppercase characters')),
|
||||
('config_password_character', _('Enforce characters (needed For Chinese/Japanese/Korean Characters)')),
|
||||
('config_password_special', _('Enforce special characters'))
|
||||
] %}
|
||||
<div class="form-group ms-3">
|
||||
<input type="checkbox" id="{{ field }}" name="{{ field }}" {% if config[field] %}checked{% endif %}>
|
||||
<label for="{{ field }}">{{ caption }}</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -225,7 +225,7 @@
|
||||
<a href="{{ identifier_link|escape }}" target="_blank" class="btn btn-xs btn-success"
|
||||
role="button">{{ identifier.format_type() }}</a>
|
||||
{% else %}
|
||||
<span class="btn btn-xs btn-success" role="button">{{ identifier.format_type() }}</span>
|
||||
<span class="btn btn-xs btn-success" role="button" title="{{ identifier_link }}">{{ identifier.format_type() }}</span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
{% else %}
|
||||
<div>
|
||||
<span>{{_('Calibre-Web Log: ')}}</span> {{_("Stream output, can't be displayed")}}
|
||||
<label for="log1">{{_('Calibre-Web Log: ')}}</label> {{_("Stream output, can't be displayed")}}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if accesslog_enable %}
|
||||
|
||||
@@ -401,6 +401,18 @@
|
||||
<label for="config_password_min_length">{{_('Minimum password length')}}</label>
|
||||
<input type="number" min="1" max="40" class="form-control" name="config_password_min_length" id="config_password_min_length" value="{% if config.config_password_min_length != None %}{{ config.config_password_min_length }}{% endif %}" autocomplete="off" required>
|
||||
</div>
|
||||
{% for field, caption in [
|
||||
('config_password_number', _('Enforce number')),
|
||||
('config_password_lower', _('Enforce lowercase characters')),
|
||||
('config_password_upper', _('Enforce uppercase characters')),
|
||||
('config_password_character', _('Enforce characters (needed For Chinese/Japanese/Korean Characters)')),
|
||||
('config_password_special', _('Enforce special characters'))
|
||||
] %}
|
||||
<div class="form-group ms-3">
|
||||
<input type="checkbox" id="{{ field }}" name="{{ field }}" {% if config[field] %}checked{% endif %}>
|
||||
<label for="{{ field }}">{{ caption }}</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
<a href="{{ identifier_link|escape }}" target="_blank" class="btn btn-xs btn-success"
|
||||
role="button">{{ identifier.format_type() }}</a>
|
||||
{% else %}
|
||||
<span class="btn btn-xs btn-success" role="button">{{ identifier.format_type() }}</span>
|
||||
<span class="btn btn-xs btn-success" role="button" title="{{ identifier_link }}">{{ identifier.format_type() }}</span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="text-body-secondary">
|
||||
<span class="fw-semibold">{{_('Calibre-Web Log: ')}}</span> {{_("Stream output, can't be displayed")}}
|
||||
<label class="fw-semibold" for="log1">{{_('Calibre-Web Log: ')}}</label> {{_("Stream output, can't be displayed")}}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if accesslog_enable %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends theme("layout.html") %}
|
||||
{% block body %}
|
||||
<div class="container-fluid user-edit-page px-0 px-lg-2">
|
||||
<div class="container-fluid user-edit-page discover px-0 px-lg-2">
|
||||
<h1 class="h3 mb-4">{{title}}</h1>
|
||||
<form role="form" method="POST" autocomplete="off" class="row g-3">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
|
||||
@@ -30,6 +30,7 @@ SQLAlchemy-Utils>=0.33.5,<0.43.0
|
||||
# metadata extraction
|
||||
rarfile>=3.2,<5.0
|
||||
scholarly>=1.2.0,<1.8
|
||||
bibtexparser>=1.1.0,<2.0.0
|
||||
markdown2>=2.0.0,<2.6.0
|
||||
html2text>=2020.1.16,<2025.4.16
|
||||
python-dateutil>=2.1,<2.10.0
|
||||
|
||||
@@ -103,6 +103,7 @@ oauth = [
|
||||
metadata = [
|
||||
"rarfile>=3.2,<5.0",
|
||||
"scholarly>=1.2.0,<1.8",
|
||||
"bibtexparser>=1.1.0,<2.0.0",
|
||||
"markdown2>=2.0.0,<2.6.0",
|
||||
"html2text>=2020.1.16,<2025.4.16",
|
||||
"python-dateutil>=2.1,<2.10.0",
|
||||
|
||||
+3263
-296
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user