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.
This commit is contained in:
Kovid Goyal 2023-09-01 09:30:30 +05:30
parent 1680139cb5
commit 02073c2618
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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'