summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/HotFolder.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks/HotFolder.py')
-rw-r--r--module/plugins/hooks/HotFolder.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py
index 6c6825954..2e210c8a2 100644
--- a/module/plugins/hooks/HotFolder.py
+++ b/module/plugins/hooks/HotFolder.py
@@ -57,14 +57,15 @@ class HotFolder(Hook):
f = open(self.getConfig("file"), "rb")
- urls = [x.strip() for x in f.readlines() if x.strip()]
+ content = f.read().strip()
f.close()
- if urls:
- name = "%s @ %s" % (self.getConfig("file"), time.strftime("%H:%M:%S %d%b%Y") )
- f = open(self.getConfig("file"), "wb")
+ if content:
+ name = "%s_%s.txt" % (self.getConfig("file"), time.strftime("%H-%M-%S %d%b%Y") )
+
+ f = open(join(self.getConfig("folder"), name), "wb")
f.close()
-
- self.core.server_methods.add_package(f.name, urls, 1)
+
+ self.core.server_methods.add_package(f.name, [f.name], 1)
for f in listdir(self.getConfig("folder")):
path = join(self.getConfig("folder"), f)