From 802453a7ec8585689440a4aeec02a8c86fc67125 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 6 Jul 2024 13:01:12 +0530 Subject: [PATCH] No need to store all_storage_ids on file objects --- src/calibre/devices/mtp/filesystem_cache.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/calibre/devices/mtp/filesystem_cache.py b/src/calibre/devices/mtp/filesystem_cache.py index d4cc7f42f5..d686e1e734 100644 --- a/src/calibre/devices/mtp/filesystem_cache.py +++ b/src/calibre/devices/mtp/filesystem_cache.py @@ -36,8 +36,6 @@ class ListEntry: class FileOrFolder: def __init__(self, entry, fs_cache): - self.all_storage_ids = fs_cache.all_storage_ids - self.object_id = entry['id'] self.is_folder = entry['is_folder'] self.storage_id = entry['storage_id'] @@ -60,9 +58,9 @@ class FileOrFolder: self.last_mod_string = self.last_modified.strftime('%Y/%m/%d %H:%M') self.last_modified = as_utc(self.last_modified) - if self.storage_id not in self.all_storage_ids: + if self.storage_id not in fs_cache.all_storage_ids: raise ValueError('Storage id %s not valid for %s, valid values: %s'%(self.storage_id, - entry, self.all_storage_ids)) + entry, fs_cache.all_storage_ids)) if self.parent_id == 0: self.parent_id = self.storage_id