From 02073c2618579dd4f5c586c75d9179eeaf959d9b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 1 Sep 2023 09:30:30 +0530 Subject: [PATCH] MTP driver: Ignore AppleDouble files These are present on devices that go from USBMS to MTP via firmware update and have been connected to a Crapple computer when in USBMS mode. --- src/calibre/devices/mtp/filesystem_cache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/mtp/filesystem_cache.py b/src/calibre/devices/mtp/filesystem_cache.py index 92e2d9e1e0..14b031bc6b 100644 --- a/src/calibre/devices/mtp/filesystem_cache.py +++ b/src/calibre/devices/mtp/filesystem_cache.py @@ -66,8 +66,9 @@ class FileOrFolder: if self.storage_id == self.object_id: self.storage_prefix = 'mtp:::%s:::'%self.persistent_id + # Ignore non ebook files and AppleDouble files self.is_ebook = (not self.is_folder and - self.name.rpartition('.')[-1].lower() in bexts) + self.name.rpartition('.')[-1].lower() in bexts and not self.name.startswith('._')) def __repr__(self): name = 'Folder' if self.is_folder else 'File'