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.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py
index 5a65146b9..d556537aa 100644
--- a/module/plugins/hooks/HotFolder.py
+++ b/module/plugins/hooks/HotFolder.py
@@ -14,22 +14,22 @@ from module.utils import fs_encode, save_join as fs_join
class HotFolder(Addon):
__name__ = "HotFolder"
__type__ = "hook"
- __version__ = "0.17"
+ __version__ = "0.18"
__status__ = "testing"
- __config__ = [("folder" , "str" , "Folder to observe" , "container"),
- ("watch_file", "bool", "Observe link file" , False ),
- ("keep" , "bool", "Keep added containers", True ),
- ("file" , "str" , "Link file" , "links.txt")]
+ __config__ = [("folder" , "str" , "Folder to watch" , "watchdir" ),
+ ("watchfile", "bool", "Watch link file" , False ),
+ ("delete" , "bool", "Delete added containers", False ),
+ ("file" , "str" , "Link file" , "links.txt")]
__description__ = """Observe folder and file for changes and add container and links"""
__license__ = "GPLv3"
__authors__ = [("RaNaN", "RaNaN@pyload.de")]
- def init(self):
+ def activate(self):
self.interval = 30
- self.init_periodical()
+ self.init_periodical(threaded=True)
def periodical(self):
@@ -40,7 +40,7 @@ class HotFolder(Addon):
if not os.path.isdir(os.path.join(folder, "finished")):
os.makedirs(os.path.join(folder, "finished"))
- if self.get_config('watch_file'):
+ if self.get_config('watchfile'):
with open(file, "a+") as f:
f.seek(0)
content = f.read().strip()
@@ -62,7 +62,7 @@ class HotFolder(Addon):
if not os.path.isfile(path) or f.endswith("~") or f.startswith("#") or f.startswith("."):
continue
- newpath = os.path.join(folder, "finished", f if self.get_config('keep') else "tmp_" + f)
+ newpath = os.path.join(folder, "finished", "tmp_" + f if self.get_config('delete') else f)
move(path, newpath)
self.log_info(_("Added %s from HotFolder") % f)