Go back to using ascii-ized filenames for Amazon

Apparently, their email service has stopped reading metadata
from file contents. Hurray!
This commit is contained in:
Kovid Goyal 2022-09-24 07:43:49 +05:30
parent 8b5c9e9047
commit 40e2c383c8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -165,6 +165,11 @@ def send_mails(jobnames, callback, attachments, to_s, subjects,
# irony that they are called "tech" companies.
# https://bugs.launchpad.net/calibre/+bug/1989282
from calibre.utils.short_uuid import uuid4
if '@kindle.com' in to:
# https://www.mobileread.com/forums/showthread.php?t=349290
from calibre.utils.filenames import ascii_filename
aname = ascii_filename(aname)
else:
aname = f'{uuid4()}.' + aname.rpartition('.')[-1]
subject = uuid4()
text = uuid4()