You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add retained formats functionality for auto-conversion
Implements ability to keep original book formats after conversion to target format.
Users can now select which formats to retain via CWA settings UI.
Features:
- New auto_convert_retained_formats setting with checkbox grid UI
- Automatic conflict prevention (target format always retained)
- Database migration support for backward compatibility
- Enhanced ingest processor with robust format addition logic
Credit to @angelicadvocate for original implementation concept in PR #284.
Fixes edge cases including race conditions, UI state handling, and iteration safety.
{{_('The formats selected here will always be added to the library, even after they have been converted to the target format. However, if the format is in the "CWA Auto-Ingest - Ignored Formats" list, it will not be imported. Note that the target format is always retained.')}}
<labelfor="convert_retained_{{ format }}" style="width: 75px; padding-right: 6px; display: inline-block !important;">
440
+
{% if format in cwa_settings.get('auto_convert_retained_formats', []) or format == cwa_settings['auto_convert_target_format'] %}
441
+
{% if format in cwa_settings['auto_ingest_ignored_formats'] %}
442
+
<inputtype="checkbox" id="convert_retained_{{ format }}" name="convert_retained_{{ format }}" value="{{ format }}" disabledstyle="vertical-align: middle; accent-color: var(--color-secondary); display: inline-block !important;">
443
+
{% elif format == cwa_settings['auto_convert_target_format'] %}
444
+
<inputtype="checkbox" id="convert_retained_{{ format }}" name="convert_retained_{{ format }}" value="{{ format }}" checkeddisabledstyle="vertical-align: middle; accent-color: var(--color-secondary); display: inline-block !important;" title="Target format is always retained">
445
+
{% else %}
446
+
<inputtype="checkbox" id="convert_retained_{{ format }}" name="convert_retained_{{ format }}" value="{{ format }}" checkedstyle="vertical-align: middle; accent-color: var(--color-secondary); display: inline-block !important;">
447
+
{% endif %}
448
+
{% else %}
449
+
{% if format in cwa_settings['auto_ingest_ignored_formats'] %}
450
+
<inputtype="checkbox" id="convert_retained_{{ format }}" name="convert_retained_{{ format }}" value="{{ format }}" disabledstyle="vertical-align: middle; accent-color: var(--color-secondary); display: inline-block !important;">
451
+
{% else %}
452
+
<inputtype="checkbox" id="convert_retained_{{ format }}" name="convert_retained_{{ format }}" value="{{ format }}" style="vertical-align: middle; accent-color: var(--color-secondary); display: inline-block !important;">
453
+
{% endif %}
454
+
{% endif %}
455
+
<spanstyle="padding-left: 4px; vertical-align: middle;">{{ format }}</span>
0 commit comments