don't translate empty string
[enigma2.git] / lib / python / Tools / Directories.py
index 9cd29511a9d3fd1046c10ea812620af479a2128c..003d9a8e81fbf0f40dc4563b8e710b9b5d900286 100644 (file)
@@ -41,7 +41,9 @@ def getRecordingFilename(basename):
        while True:
                path = "/hdd/movies/" + filename
                if i > 0:
-                       path += str(i)
-               if os.glob(path + "*").size() == 0:
+                       path += "_%03d" % i
+               try:
+                       open(path + ".ts")
+                       i += 1
+               except IOError:
                        return path
-               i+=1