diff options
author | hut <hut@lavabit.com> | 2010-06-04 16:50:24 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-06-04 16:50:24 +0200 |
commit | 6bd1c59255793f2ca565c992809c32129111f71a (patch) | |
tree | 55e42f58fec1ee48bffd4095ba56b7de0e0c2edb /ranger | |
parent | d563d1a286367543b1630ec0218679a5d2d5bde1 (diff) | |
download | ranger-6bd1c59255793f2ca565c992809c32129111f71a.tar.gz |
fsobject: ignore ".part" extensions when determining mimetype
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/fsobject/fsobject.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py index 865698b3..4ca5a6c8 100644 --- a/ranger/fsobject/fsobject.py +++ b/ranger/fsobject/fsobject.py @@ -107,7 +107,10 @@ class FileSystemObject(MimeTypeAware, FileManagerAware): def set_mimetype(self): """assign attributes such as self.video according to the mimetype""" - self._mimetype = self.mimetypes.guess_type(self.basename, False)[0] + basename = self.basename + if self.extension == 'part': + basename = basename[0:-5] + self._mimetype = self.mimetypes.guess_type(basename, False)[0] if self._mimetype is None: self._mimetype = '' |