mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MTP driver: Ignore folders whose names end with .sdr on Kindle devices
This commit is contained in:
parent
32814c3607
commit
58de08aed0
@ -68,4 +68,4 @@ class DeviceDefaults:
|
||||
ans['calibre_file_paths'] = {'metadata':'NOOK/metadata.calibre', 'driveinfo':'NOOK/driveinfo.calibre'}
|
||||
return ans
|
||||
|
||||
return {}
|
||||
return {}, vid, pid
|
||||
|
@ -56,6 +56,7 @@ class MTP_DEVICE(BASE):
|
||||
self._prefs = None
|
||||
self.device_defaults = DeviceDefaults()
|
||||
self.current_device_defaults = {}
|
||||
self.current_vid = self.current_pid = -1
|
||||
self.calibre_file_paths = {'metadata':self.METADATA_CACHE, 'driveinfo':self.DRIVEINFO}
|
||||
self.highlight_ignored_folders = False
|
||||
|
||||
@ -88,6 +89,8 @@ class MTP_DEVICE(BASE):
|
||||
if storage_id in ignored_folders:
|
||||
# Use the users ignored folders settings
|
||||
return '/'.join(lpath) in {icu_lower(x) for x in ignored_folders[storage_id]}
|
||||
if self.current_vid == 0x1949 and lpath and lpath[-1].endswith('.sdr'):
|
||||
return True
|
||||
|
||||
# Implement the default ignore policy
|
||||
|
||||
@ -136,7 +139,7 @@ class MTP_DEVICE(BASE):
|
||||
isoformat(utcnow()))
|
||||
self.prefs['history'] = h
|
||||
|
||||
self.current_device_defaults = self.device_defaults(device, self)
|
||||
self.current_device_defaults, self.current_vid, self.current_pid = self.device_defaults(device, self)
|
||||
self.calibre_file_paths = self.current_device_defaults.get(
|
||||
'calibre_file_paths', {'metadata':self.METADATA_CACHE, 'driveinfo':self.DRIVEINFO})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user