mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
SONY driver: Remove comments from books sent to SONY readers as the reader chokes on them
This commit is contained in:
parent
5bd51689e5
commit
0bb10e3f81
@ -74,6 +74,12 @@ class DevicePlugin(Plugin):
|
||||
#: For example: ``frozenset(['kobo'])``
|
||||
VIRTUAL_BOOK_EXTENSIONS = frozenset([])
|
||||
|
||||
#: Whether to nuke comments in the copy of the book sent to the device. If
|
||||
#: not None this should be short string that the comments will be replaced
|
||||
#: by.
|
||||
NUKE_COMMENTS = None
|
||||
|
||||
|
||||
@classmethod
|
||||
def get_gui_name(cls):
|
||||
if hasattr(cls, 'gui_name'):
|
||||
|
@ -56,6 +56,8 @@ class PRS505(USBMS):
|
||||
|
||||
SUPPORTS_SUB_DIRS = True
|
||||
MUST_READ_METADATA = True
|
||||
NUKE_COMMENTS = _('Comments have been removed as the SONY reader'
|
||||
' chokes on them')
|
||||
SUPPORTS_USE_AUTHOR_SORT = True
|
||||
EBOOK_DIR_MAIN = 'database/media/books'
|
||||
SCAN_FROM_ROOT = False
|
||||
|
@ -391,6 +391,10 @@ class DeviceManager(Thread): # {{{
|
||||
newmi.template_to_attribute(mi, cpb)
|
||||
else:
|
||||
newmi = mi
|
||||
nuke_comments = getattr(self.connected_device,
|
||||
'NUKE_COMMENTS', None)
|
||||
if nuke_comments is not None:
|
||||
mi.comments = nuke_comments
|
||||
set_metadata(stream, newmi, stream_type=ext)
|
||||
except:
|
||||
if DEBUG:
|
||||
|
Loading…
x
Reference in New Issue
Block a user