CouchPotato file tag for renamer

This commit is contained in:
Ruud
2011-08-03 22:00:26 +02:00
parent aa24e3e249
commit a954d269f6
3 changed files with 5 additions and 4 deletions
+3
View File
@@ -15,6 +15,9 @@ class Downloader(Plugin):
def download(self, data = {}):
pass
def cpTag(self, movie):
return '.cp(' + movie['library'].get('identifier') + ')' if movie['library'].get('identifier') else ''
def isDisabled(self):
return not self.isEnabled()
@@ -23,8 +23,7 @@ class Blackhole(Downloader):
if not directory or not os.path.isdir(directory):
log.error('No directory set for blackhole %s download.' % data.get('type'))
else:
cp_tag = '.cp(' + movie['library'].get('identifier') + ')' if movie['library'].get('identifier') else ''
fullPath = os.path.join(directory, '%s%s.%s' % (toSafeString(data.get('name')), cp_tag , data.get('type')))
fullPath = os.path.join(directory, '%s%s.%s' % (toSafeString(data.get('name')), self.cpTag(movie) , data.get('type')))
try:
if not os.path.isfile(fullPath):
+1 -2
View File
@@ -35,13 +35,12 @@ class Sabnzbd(Downloader):
pp = False
cp_tag = '.cp(' + movie['library'].get('identifier') + ')' if movie['library'].get('identifier') else ''
params = {
'apikey': self.conf('api_key'),
'cat': self.conf('category'),
'mode': 'addurl',
'name': data.get('url'),
'nzbname': '%s%s' % (data.get('name'), cp_tag),
'nzbname': '%s%s' % (data.get('name'), self.cpTag(movie)),
}
# sabNzbd complains about "invalid archive file" for newzbin urls