From 3c2a00b17b589c15005029a678a0b2e79ee0e846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20K=C3=A5berg?= Date: Fri, 5 Apr 2013 14:21:15 +0200 Subject: [PATCH] add copy and move to file actions --- couchpotato/core/plugins/renamer/__init__.py | 9 +++++---- couchpotato/core/plugins/renamer/main.py | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/couchpotato/core/plugins/renamer/__init__.py b/couchpotato/core/plugins/renamer/__init__.py index d80618b..f4ea8a7 100644 --- a/couchpotato/core/plugins/renamer/__init__.py +++ b/couchpotato/core/plugins/renamer/__init__.py @@ -113,11 +113,12 @@ config = [{ 'description': 'Replace all the spaces with a character. Example: ".", "-" (without quotes). Leave empty to use spaces.', }, { - 'name': 'links', - 'default': '0', + 'name': 'file_action', + 'label': 'File Action', + 'default': 'move', 'type': 'dropdown', - 'values': [('Disable', 0), ('Hard link', 'hard'), ('Sym link', 'sym')], - 'description': 'Use hard links or sym links instead of moving files, ideal for Torrent users.', + 'values': [('Move', 'move'), ('Copy', 'copy'), ('Hard link', 'hardlink'), ('Sym link', 'symlink')], + 'description': 'Define which kind of file operation you want to use. Before you start using hard links or sym links, read about thire possible drawbacks.', 'advanced': True, }, { diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index e4becf5..d5509b0 100644 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -524,10 +524,12 @@ class Renamer(Plugin): def moveFile(self, old, dest): dest = ss(dest) try: - if self.conf('link') == 'hard': + if self.conf('file_action') == 'hardlink': linktastic.link(old, dest) - elif self.conf('link') == 'sym': + elif self.conf('file_action') == 'symlink': linktastic.symlink(old, dest) + elif self.conf('file_action') == 'copy': + shutil.copy(old, dest) else: shutil.move(old, dest)