From 77baa05d3dbc3f13ae1d4aae1214775b2eb47c2f Mon Sep 17 00:00:00 2001 From: GRiker Date: Tue, 18 Jun 2013 09:14:34 -0600 Subject: [PATCH] When in synchronous mode (direct to iBooks), disable PDF transfers, as we can't update metadata in iTunes. Not sure when this started, but as of 11.0.4 it's broken. --- src/calibre/devices/apple/driver.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/calibre/devices/apple/driver.py b/src/calibre/devices/apple/driver.py index 66d27bad2b..aa90e2a9ef 100644 --- a/src/calibre/devices/apple/driver.py +++ b/src/calibre/devices/apple/driver.py @@ -1073,6 +1073,24 @@ class ITUNES(DriverBase): self.plugboards = plugboards self.plugboard_func = pb_func + def settings(self): + ''' + iBooks won't accept PDFs through the automation interface (11.0.4), not sure + when that became a problem. If we're directly connected to the iDevice, + remove PDF from list of supported formats. + ''' + if self.verbose: + logger().info("%s.settings()" % self.__class__.__name__) + + # If direct connection, remove PDF support + if self.manual_sync_mode: + opts = super(ITUNES, self).settings() + if 'pdf' in opts.format_map: + opts.format_map.remove('pdf') + return opts + else: + return super(ITUNES, self).settings() + def shutdown(self): if False and self.verbose: logger().info("%s.shutdown()\n" % self.__class__.__name__) @@ -3014,6 +3032,7 @@ class ITUNES(DriverBase): lb_added.year.set(metadata_x.pubdate.year) if db_added: + # This will fail for PDF files db_added.name.set(metadata_x.title) db_added.album.set(metadata_x.title) db_added.artist.set(authors_to_string(metadata_x.authors))