diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-07-21 21:42:43 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-07-21 21:42:43 +0200 |
commit | 6172180c95695cae84e71484b4c60af4166ebf89 (patch) | |
tree | 17f4d63cca0b8407bb556911929725532bcede26 /pyload/datatypes | |
parent | Replace rule Hook -> Addon (diff) | |
download | pyload-6172180c95695cae84e71484b4c60af4166ebf89.tar.xz |
guess media types by name
Diffstat (limited to 'pyload/datatypes')
-rw-r--r-- | pyload/datatypes/PyFile.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pyload/datatypes/PyFile.py b/pyload/datatypes/PyFile.py index 7bb3a4e31..f15ad7ee0 100644 --- a/pyload/datatypes/PyFile.py +++ b/pyload/datatypes/PyFile.py @@ -21,6 +21,7 @@ from ReadWriteLock import ReadWriteLock from pyload.Api import ProgressInfo, DownloadProgress, FileInfo, DownloadInfo, DownloadStatus from pyload.utils import lock, read_lock +from pyload.utils.filetypes import guess_type statusMap = { "none": 0, @@ -123,7 +124,11 @@ class PyFile(object): if type(name) == str: name = name.decode("utf8") - self._name = name + # media type is updated if needed + if self._name != name: + self.media = guess_type(name) + self._name = name + name = property(getName, setName) |