From 177063d39cd424a81f3386c9b23e18cd8c1d184a Mon Sep 17 00:00:00 2001 From: Kyle Klein Date: Mon, 8 Apr 2013 14:13:33 -0700 Subject: [PATCH] Add File Action Move & Sym link --- couchpotato/core/plugins/renamer/__init__.py | 2 +- couchpotato/core/plugins/renamer/main.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/plugins/renamer/__init__.py b/couchpotato/core/plugins/renamer/__init__.py index f90828bc..90f5c980 100644 --- a/couchpotato/core/plugins/renamer/__init__.py +++ b/couchpotato/core/plugins/renamer/__init__.py @@ -117,7 +117,7 @@ config = [{ 'label': 'File Action', 'default': 'move', 'type': 'dropdown', - 'values': [('Move', 'move'), ('Copy', 'copy'), ('Hard link', 'hardlink'), ('Sym link', 'symlink')], + 'values': [('Move', 'move'), ('Copy', 'copy'), ('Hard link', 'hardlink'), ('Sym link', 'symlink'), ('Move & Sym link', 'move_symlink')], 'description': 'Define which kind of file operation you want to use. Before you start using hard links or sym links, PLEASE read about their possible drawbacks.', 'advanced': True, }, diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index 4b1fab13..4e3e6ade 100644 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -527,6 +527,9 @@ Remove it if you want it to be renamed (again, or at least let it try again) symlink(old, dest) elif self.conf('file_action') == 'copy': shutil.copy(old, dest) + elif self.conf('file_action') == 'move_symlink': + shutil.move(old, dest) + linktastic.symlink(dest, old) else: shutil.move(old, dest)