Kindle driver: Allow using a value of * in Preferences->Output options->MOBI Output to have the driver mark all books sent to the device as personal documents

This commit is contained in:
Kovid Goyal 2025-04-01 12:52:33 +05:30
parent 90abfc5a37
commit c82f8b2838
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 2 deletions

View File

@ -63,7 +63,9 @@ class MOBIOutput(OutputFormatPlugin):
' This option has no effect on the conversion. It is used' ' This option has no effect on the conversion. It is used'
' only when sending MOBI files to a device. If the file' ' only when sending MOBI files to a device. If the file'
' being sent has the specified tag, it will be marked as' ' being sent has the specified tag, it will be marked as'
' a personal document when sent to the Kindle.') ' a personal document when sent to the Kindle. Use the value *'
' to match all books.'
)
), ),
OptionRecommendation(name='mobi_ignore_margins', OptionRecommendation(name='mobi_ignore_margins',
recommended_value=False, recommended_value=False,

View File

@ -374,7 +374,7 @@ class MetadataUpdater:
subjects = '; '.join(mi.tags) subjects = '; '.join(mi.tags)
update_exth_record((105, normalize(subjects).encode(self.codec, 'replace'))) update_exth_record((105, normalize(subjects).encode(self.codec, 'replace')))
if kindle_pdoc and kindle_pdoc in mi.tags: if kindle_pdoc and (kindle_pdoc == '*' or kindle_pdoc in mi.tags):
added_501 = True added_501 = True
update_exth_record((501, b'PDOC')) update_exth_record((501, b'PDOC'))