diff --git a/src/calibre/devices/interface.py b/src/calibre/devices/interface.py index 2a87e39313..2c5f60ecfe 100644 --- a/src/calibre/devices/interface.py +++ b/src/calibre/devices/interface.py @@ -487,7 +487,8 @@ class DevicePlugin(Plugin): Set the device name in the driveinfo file to 'name'. This setting will persist until the file is re-created or the name is changed again. - Non-disk devices will ignore this request. + Non-disk devices should implement this method based on the location + codes returned by the get_device_information() method. ''' pass diff --git a/src/calibre/devices/mtp/windows/driver.py b/src/calibre/devices/mtp/windows/driver.py index 51f5bfd60d..e97461bc15 100644 --- a/src/calibre/devices/mtp/windows/driver.py +++ b/src/calibre/devices/mtp/windows/driver.py @@ -204,6 +204,10 @@ class MTP_DEVICE(MTPDeviceBase): def get_device_information(self, end_session=True): d = self.dev.data dv = d.get('device_version', '') + for sid, location_code in ( (self._main_id, 'main'), (self._carda_id, + 'A'), (self._cardb_id, 'B')): + if sid is None: continue + # TODO: Implement the drive info dict return (self.current_friendly_name, dv, dv, '') @same_thread