summaryrefslogtreecommitdiffstats
path: root/pyload/datatypes/PyFile.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/datatypes/PyFile.py')
-rw-r--r--pyload/datatypes/PyFile.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pyload/datatypes/PyFile.py b/pyload/datatypes/PyFile.py
index 58d9f6a6f..18ac06c50 100644
--- a/pyload/datatypes/PyFile.py
+++ b/pyload/datatypes/PyFile.py
@@ -21,6 +21,7 @@ from ReadWriteLock import ReadWriteLock
from pyload.Api import ProgressInfo, ProgressType, DownloadProgress, FileInfo, DownloadInfo, DownloadStatus
from pyload.utils import lock, read_lock
+from pyload.utils.fs import safe_filename
from pyload.utils.filetypes import guess_type
statusMap = {
@@ -75,7 +76,7 @@ class PyFile(object):
self.m = manager
self.fid = int(fid)
- self._name = name
+ self._name = safe_filename(name)
self._size = size
self.filestatus = filestatus
self.media = media
@@ -127,6 +128,8 @@ class PyFile(object):
if type(name) == str:
name = name.decode("utf8")
+ name = safe_filename(name)
+
# media type is updated if needed
if self._name != name:
self.media = guess_type(name)