mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-30 08:33:55 +02:00
Linux MTP driver: Ignore Apple devices
This commit is contained in:
parent
1d092d836b
commit
517d283d79
1 changed files with 5 additions and 2 deletions
|
|
@ -25,6 +25,8 @@ def fingerprint(d):
|
|||
return MTPDevice(d.busnum, d.devnum, d.vendor_id, d.product_id, d.bcd,
|
||||
d.serial, d.manufacturer, d.product)
|
||||
|
||||
APPLE = 0x05ac
|
||||
|
||||
class MTP_DEVICE(MTPDeviceBase):
|
||||
|
||||
# libusb(x) does not work on OS X. So no MTP support for OS X
|
||||
|
|
@ -53,7 +55,8 @@ def detect_managed_devices(self, devices_on_system, force_refresh=False):
|
|||
devs = set()
|
||||
for d in devices_on_system:
|
||||
fp = fingerprint(d)
|
||||
if fp not in self.blacklisted_devices:
|
||||
if fp not in self.blacklisted_devices and fp.vendor_id != APPLE:
|
||||
# Do not try to open Apple devices
|
||||
devs.add(fp)
|
||||
|
||||
# Clean up ejected devices
|
||||
|
|
@ -93,7 +96,7 @@ def debug_managed_device_detection(self, devices_on_system, output):
|
|||
p(err)
|
||||
return False
|
||||
devs = [d for d in devices_on_system if (d.vendor_id, d.product_id)
|
||||
in self.known_devices]
|
||||
in self.known_devices and d.vendor_id != APPLE]
|
||||
if not devs:
|
||||
p('No known MTP devices connected to system')
|
||||
return False
|
||||
|
|
|
|||
Loading…
Reference in a new issue