Merge branch 'links' of git://github.com/jkaberg/CouchPotatoServer into jkaberg-links

This commit is contained in:
Ruud committed 2013-04-05 18:00:17 +02:00
commit f77b598899
6 files changed
+126 -1

No files matched your search

+9 -1
View File
@@ -10,6 +10,7 @@ from couchpotato.core.plugins.base import Plugin
from couchpotato.core.settings.model import Library, File, Profile, Release, \
ReleaseInfo
from couchpotato.environment import Env
import linktastic.linktastic as linktastic
import errno
import os
import re
@@ -523,7 +524,14 @@ class Renamer(Plugin):
def moveFile(self, old, dest):
dest = ss(dest)
try:
shutil.move(old, dest)
if self.conf('file_action') == 'hardlink':
linktastic.link(old, dest)
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)
try:
os.chmod(dest, Env.getPermission('file'))