From 9e008a62bcf1a1879742e71a400aac5457824be0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 7 Nov 2022 10:23:29 +0530 Subject: [PATCH] Sending by email: When adding comments also add series --- src/calibre/gui2/email.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/gui2/email.py b/src/calibre/gui2/email.py index 68504245ec..af6831bda9 100644 --- a/src/calibre/gui2/email.py +++ b/src/calibre/gui2/email.py @@ -440,6 +440,10 @@ class EmailMixin: # {{{ os.path.splitext(f)[1][1:].upper()) if mi.comments and gprefs['add_comments_to_email']: from calibre.utils.html2text import html2text + from calibre.ebooks.metadata import fmt_sidx + if mi.series: + sidx=fmt_sidx(1.0 if mi.series_index is None else mi.series_index, use_roman=config['use_roman_numerals_for_series_number']) + texts[-1] += '\n\n' + _('{series_index} of {series}').format(series_index=sidx, series=mi.series) texts[-1] += '\n\n' + _('About this book:') + '\n\n' + textwrap.fill(html2text(mi.comments)) if is_for_kindle(to): prefix = str(newmi.title or t)