From c82f8b2838ce4878d5b855dd597d043e8082564a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 1 Apr 2025 12:52:33 +0530 Subject: [PATCH] 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 --- src/calibre/ebooks/conversion/plugins/mobi_output.py | 4 +++- src/calibre/ebooks/metadata/mobi.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/conversion/plugins/mobi_output.py b/src/calibre/ebooks/conversion/plugins/mobi_output.py index cfe03aa79e..e8aeff0ec4 100644 --- a/src/calibre/ebooks/conversion/plugins/mobi_output.py +++ b/src/calibre/ebooks/conversion/plugins/mobi_output.py @@ -63,7 +63,9 @@ class MOBIOutput(OutputFormatPlugin): ' This option has no effect on the conversion. It is used' ' only when sending MOBI files to a device. If the file' ' 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', recommended_value=False, diff --git a/src/calibre/ebooks/metadata/mobi.py b/src/calibre/ebooks/metadata/mobi.py index 427096bfe5..a8f447c7fa 100644 --- a/src/calibre/ebooks/metadata/mobi.py +++ b/src/calibre/ebooks/metadata/mobi.py @@ -374,7 +374,7 @@ class MetadataUpdater: subjects = '; '.join(mi.tags) 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 update_exth_record((501, b'PDOC'))