From 4d7ed1b4c6e696d5888dd1fef40aec13c9be1fe4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 3 Sep 2012 17:23:12 +0530 Subject: [PATCH] ... --- src/calibre/devices/mtp/filesystem_cache.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/devices/mtp/filesystem_cache.py b/src/calibre/devices/mtp/filesystem_cache.py index 216e06031f..da0445962b 100644 --- a/src/calibre/devices/mtp/filesystem_cache.py +++ b/src/calibre/devices/mtp/filesystem_cache.py @@ -80,6 +80,10 @@ class FileOrFolder(object): __str__ = __repr__ __unicode__ = __repr__ + @property + def empty(self): + return not self.files and not self.folders + @property def id_map(self): return self.fs_cache().id_map @@ -217,6 +221,8 @@ class FilesystemCache(object): def iterebooks(self, storage_id): for x in self.id_map.itervalues(): if x.storage_id == storage_id and x.is_ebook: + if x.parent_id == storage_id and x.name.lower().endswith('.txt'): + continue # Ignore .txt files in the root yield x def resolve_mtp_id_path(self, path):