Skip to content

Commit 6822c7a

Browse files
Fixed current automerge option not being the one shown in the CWA settings page.
Fixed Enable Hardcover checkbox being unchecked regardless of whether the feature was enabled or not. Fixed issue of existing ratings or previously enter ratings being wiped after fetching metadata
1 parent a55efba commit 6822c7a

5 files changed

Lines changed: 15 additions & 6 deletions

File tree

root/app/calibre-web/cps/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,7 @@ def _configuration_update_helper():
18711871
config.config_use_goodreads)
18721872

18731873
# Hardcover configuration
1874-
_config_checkbox(to_save, "config_use_hardcover")
1874+
_config_checkbox(to_save, "config_hardcover_sync")
18751875
_config_string(to_save, "config_hardcover_token")
18761876

18771877
_config_int(to_save, "config_updatechannel")

root/app/calibre-web/cps/cwa_functions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def set_cwa_settings():
162162
'rtf', 'snb', 'tcr', 'txt', 'txtz']
163163
target_formats = ['epub', 'azw3', 'kepub', 'mobi', 'pdf']
164164
automerge_options = ['ignore', 'overwrite', 'new_record']
165+
autoingest_options = ['ignore', 'overwrite', 'new_record']
165166

166167
boolean_settings = []
167168
string_settings = []
@@ -235,8 +236,8 @@ def set_cwa_settings():
235236
...
236237

237238
return render_title_template("cwa_settings.html", title=_("Calibre-Web Automated User Settings"), page="cwa-settings",
238-
cwa_settings=cwa_settings, ignorable_formats=ignorable_formats,
239-
target_formats=target_formats, automerge_options=automerge_options)
239+
cwa_settings=cwa_settings, ignorable_formats=ignorable_formats, target_formats=target_formats,
240+
automerge_options=automerge_options, autoingest_options=autoingest_options)
240241

241242
##————————————————————————————————————————————————————————————————————————————##
242243
## ##

root/app/calibre-web/cps/static/js/get_meta.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ $(function () {
6262
$("#title").val(book.title);
6363
}
6464
$("#languages").val(uniqueLanguages.join(", "));
65-
$("#rating").data("rating").setValue(Math.round(book.rating));
65+
// Removed as users can't fetch ratings from metadata providers
66+
// $("#rating").data("rating").setValue(Math.round(book.rating));
6667

6768
if (updateItems.cover && book.cover && $("#cover_url").length) {
6869
$(".cover img").attr("src", book.cover);

root/app/calibre-web/cps/templates/config_edit.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ <h4 class="panel-title">
168168
</div>
169169
{% endif %}
170170
<div class="form-group">
171-
<input type="checkbox" id="config_use_hardcover" name="config_use_hardcover" data-control="hardcover-settings" {% if config.config_use_hardcover %}checked{% endif %}>
172-
<label for="config_use_hardcover">{{_('Use Hardcover')}}</label>
171+
<input type="checkbox" id="config_hardcover_sync" name="config_hardcover_sync" data-control="hardcover-settings" {% if config.config_hardcover_sync %}checked{% endif %}>
172+
<label for="config_hardcover_sync">{{_('Enable Hardcover Sync')}}</label>
173173
</div>
174174
<div data-related="hardcover-settings">
175175
<div class="form-group">

root/app/calibre-web/cps/templates/cwa_settings.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,13 @@ <h4 class="settings-section-header">CWA Auto-Ingest Automerge</h4>
208208
<option value="ignore">ignore</option>
209209
<option value="overwrite">overwrite</option>
210210
<option value="new_record" selected="">new_record</option>
211+
{% for option in autoingest_options -%}
212+
{% if cwa_settings['auto_ingest_automerge'] == option %}
213+
<option value="{{ format }}" selected>{{ format }}</option>
214+
{% else %}
215+
<option value="{{ format }}">{{ format }}</option>
216+
{% endif %}
217+
{% endfor %}
211218
</select>
212219

213220
<h4>Possible Values:</h4>

0 commit comments

Comments
 (0)