Skip to content

Sync upstream - #377

Merged
holta merged 26 commits into
iiab:masterfrom
chapmanjacobd:sync-upstream
Aug 1, 2026
Merged

Sync upstream#377
holta merged 26 commits into
iiab:masterfrom
chapmanjacobd:sync-upstream

Conversation

@chapmanjacobd

Copy link
Copy Markdown
Member

Resolves merge conflicts at imports area

Replaces #376

@holta

lb803 and others added 26 commits December 20, 2025 11:15
The 'Get Started with Calibre-Web' email had a hardcoded English body and a
subject translated in the triggering user's locale (typically the admin), so a
French user received it in English. Wrap subject+body composition in
flask_babel.force_locale(recipient_locale), make the body translatable, and
thread the recipient locale from reset_password and /register. French
translations added; other languages fall back to English until translated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The scroll detection comparison was too strict for mobile browsers
that render subpixel scroll positions. Added 5px tolerance so the
infinite scroll triggers reliably on mobile devices.

Refs: janeczku#3664
The download_link endpoint called .lower() on the User-Agent header value without providing a default, causing AttributeError when the header is absent. This matches the safe pattern already used in render_template.py
The custom lower() SQL function registered in cps/db.py transliterates
author names via unidecode, so the case-insensitive lookup in
prepare_authors() also matched authors whose names are genuinely
different but collapse to the same ASCII string (accented vs. plain
Latin names, or Chinese homophones). The code then renamed that matched
author onto the freshly entered name, overwriting a distinct existing
author row and raising:

    (sqlite3.IntegrityError) UNIQUE constraint failed: authors.name

Restrict the case-rename branch to matches that are equal ignoring case
only (casefold), so distinct authors are left untouched. Genuine
case-only renames (e.g. "stephen king" -> "Stephen King") still work.

Fixes janeczku#3403
Fixes janeczku#3170

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@holta holta added the enhancement New feature or request label Aug 1, 2026
@holta

holta commented Aug 1, 2026

Copy link
Copy Markdown
Member

Great!

@chapmanjacobd Summarize the merge conflict you fixed, to make it more visible if possible?

@chapmanjacobd

chapmanjacobd commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

hmm that's weird that clicking on the Merge janeczku/master into sync-upstream commit 32f6f95 shows the whole branch diff 32f6f95

But basically if you look at 32f6f95 directly (ie. git show 32f6f95 you'll see this:

commit 32f6f95b9059ac9190d324d2ab80893d3c9b8fb8
Merge: dc95d968 b549da05
Author: Jacob Chapman <7908073+chapmanjacobd@users.noreply.github.com>
Date:   3 hours ago

    Merge janeczku/master into sync-upstream

diff --cc cps/admin.py
index 12b12a39,3c108b7c..e7c08f78
--- a/cps/admin.py
+++ b/cps/admin.py
@@@ -49,13 -48,13 +49,14 @@@ from . import db, calibre_db, ub, web_s
      kobo_sync_status, schedule
  from .helper import check_valid_domain, send_test_mail, reset_password, generate_password_hash, check_email, \
      valid_email, check_username
  from .embed_helper import get_calibre_binarypath
  from .gdriveutils import is_gdrive_ready, gdrive_support
+ from .binary_helper import resolve_binary_path, SUPPORTED_KEPUBIFY_BINARIES, SUPPORTED_UNRAR_BINARIES
  from .render_template import render_title_template, get_sidebar_config
  from .services.worker import WorkerThread
 +from .subproc_wrapper import process_open
  from .usermanagement import user_login_required
  from .cw_babel import get_available_translations, get_available_locale, get_user_locale_language
  from . import debug_info
  from .string_helper import strip_whitespaces
  
diff --cc cps/editbooks.py
index f47aee02,c13870df..bf529ee0
--- a/cps/editbooks.py
+++ b/cps/editbooks.py
@@@ -35,17 -35,17 +35,18 @@@ from flask_babel import get_local
  from .cw_login import current_user
  from sqlalchemy.exc import OperationalError, IntegrityError, InterfaceError
  from sqlalchemy.orm.exc import StaleDataError
  from sqlalchemy.sql.expression import func
  
 -from . import constants, logger, isoLanguages, gdriveutils, uploader, helper, kobo_sync_status
 +from . import constants, logger, isoLanguages, gdriveutils, uploader, helper, kobo_sync_status, shelf
  from .clean_html import clean_string
  from . import config, ub, db, calibre_db
  from .services.worker import WorkerThread
  from .tasks.upload import TaskUpload
 +from .tasks.metadata_extract import TaskMetadataExtract
  from .render_template import render_title_template
+ from .binary_helper import resolve_binary_path, SUPPORTED_UNRAR_BINARIES
  from .kobo_sync_status import change_archived_books
  from .redirect import get_redirect_location
  from .file_helper import validate_mime_type
  from .usermanagement import user_login_required, login_required_if_no_ano
  from .string_helper import strip_whitespaces
diff --cc cps/web.py
index 9b98fa3c,5ef40763..b14777a6
--- a/cps/web.py
+++ b/cps/web.py
@@@ -45,12 -44,12 +45,13 @@@ from . import calibre_db, kobo_sync_sta
  from .search import render_search_results, render_adv_search_results
  from .gdriveutils import getFileFromEbooksFolder, do_gdrive_download
  from .helper import check_valid_domain, check_email, check_username, \
      get_book_cover, get_series_cover_thumbnail, get_download_link, send_mail, generate_random_password, \
      send_registration_mail, check_send_to_ereader, check_read_formats, tags_filters, reset_password, valid_email, \
 -    edit_book_read_status, valid_password
 +    edit_book_read_status, valid_password, get_browseable_custom_column, format_custom_column_value, \
 +    custom_column_page
+ from .binary_helper import resolve_binary_path, SUPPORTED_UNRAR_BINARIES
  from .pagination import Pagination
  from .redirect import get_redirect_location
  from .cw_babel import get_available_locale
  from .usermanagement import login_required_if_no_ano
  from .kobo_sync_status import remove_synced_book

It's just that some changes upstream also changed the import statements where we also added get_browseable_custom_column, format_custom_column_value

@holta
holta merged commit cf61717 into iiab:master Aug 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.