diff options
-rw-r--r-- | ranger/fsobject/fsobject.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py index 8468839d..f9b023d7 100644 --- a/ranger/fsobject/fsobject.py +++ b/ranger/fsobject/fsobject.py @@ -109,6 +109,10 @@ class FileSystemObject(FileManagerAware): return [c if i % 3 == 1 else (int(c) if c else 0) for i, c in \ enumerate(_extract_number_re.split(self.basename_lower))] + for attr in ('video', 'audio', 'image', 'media', 'document', 'container'): + exec("%s = lazy_property(" + "lambda self: self.set_mimetype() or self.%s)" % (attr, attr)) + def __str__(self): """returns a string containing the absolute path""" return str(self.path) |