diff --git a/couchpotato/core/downloaders/deluge/main.py b/couchpotato/core/downloaders/deluge/main.py index 1edb9ad7..6c55d1a8 100644 --- a/couchpotato/core/downloaders/deluge/main.py +++ b/couchpotato/core/downloaders/deluge/main.py @@ -3,7 +3,6 @@ from couchpotato.core.downloaders.base import Downloader, ReleaseDownloadList from couchpotato.core.helpers.encoding import isInt, ss from couchpotato.core.helpers.variable import tryFloat from couchpotato.core.logger import CPLog -from couchpotato.environment import Env from datetime import timedelta from synchronousdeluge import DelugeClient import os.path diff --git a/couchpotato/core/downloaders/nzbget/main.py b/couchpotato/core/downloaders/nzbget/main.py index 3de1f127..7d5aafdc 100644 --- a/couchpotato/core/downloaders/nzbget/main.py +++ b/couchpotato/core/downloaders/nzbget/main.py @@ -142,7 +142,7 @@ class NZBGet(Downloader): release_downloads.append({ 'id': nzb_id, 'name': nzb['NZBFilename'], - 'status': 'completed' if nzb['ParStatus'] in ['SUCCESS','NONE'] and nzb['ScriptStatus'] in ['SUCCESS','NONE'] else 'failed', + 'status': 'completed' if nzb['ParStatus'] in ['SUCCESS', 'NONE'] and nzb['ScriptStatus'] in ['SUCCESS', 'NONE'] else 'failed', 'original_status': nzb['ParStatus'] + ', ' + nzb['ScriptStatus'], 'timeleft': str(timedelta(seconds = 0)), 'folder': ss(nzb['DestDir']) @@ -181,7 +181,7 @@ class NZBGet(Downloader): for param in hist['Parameters']: if param['Name'] == 'couchpotato' and param['Value'] == release_download['id']: nzb_id = hist['ID'] - path = hist['DestDir'] + path = hist['DestDir'] if nzb_id and path and rpc.editqueue('HistoryDelete', 0, "", [tryInt(nzb_id)]): shutil.rmtree(path, True) diff --git a/couchpotato/core/downloaders/rtorrent/main.py b/couchpotato/core/downloaders/rtorrent/main.py index 566787b3..67df20a6 100755 --- a/couchpotato/core/downloaders/rtorrent/main.py +++ b/couchpotato/core/downloaders/rtorrent/main.py @@ -7,7 +7,8 @@ from datetime import timedelta from hashlib import sha1 from rtorrent import RTorrent from rtorrent.err import MethodError -import shutil, os +import os +import shutil log = CPLog(__name__) diff --git a/couchpotato/core/plugins/release/main.py b/couchpotato/core/plugins/release/main.py index 8d58ad28..61a32872 100644 --- a/couchpotato/core/plugins/release/main.py +++ b/couchpotato/core/plugins/release/main.py @@ -285,7 +285,7 @@ class Release(Plugin): for file_item in rel.files: if file_item.type.identifier == 'movie': release_name = os.path.basename(file_item.path) - break + break else: release_name = item['name'] #update status in Db @@ -297,4 +297,4 @@ class Release(Plugin): #Update all movie info as there is no release update function fireEvent('notify.frontend', type = 'release.update_status.%s' % rel.id, data = status.get('id')) - return True \ No newline at end of file + return True diff --git a/couchpotato/core/plugins/renamer/main.py b/couchpotato/core/plugins/renamer/main.py index 2c62d744..3efeb539 100755 --- a/couchpotato/core/plugins/renamer/main.py +++ b/couchpotato/core/plugins/renamer/main.py @@ -615,7 +615,7 @@ Remove it if you want it to be renamed (again, or at least let it try again) for root, dirnames, filenames in os.walk(folder): ignore_files.extend(fnmatch.filter([os.path.join(root, filename) for filename in filenames], '*%s.ignore' % tag)) - # Match all found ignore files with the tag_files and delete if found + # Match all found ignore files with the tag_files and delete if found for tag_file in tag_files: ignore_file = fnmatch.filter(ignore_files, '%s.%s.ignore' % (os.path.splitext(tag_file)[0], tag if tag else '*')) for filename in ignore_file: @@ -647,8 +647,8 @@ Remove it if you want it to be renamed (again, or at least let it try again) # Find all .ignore files in folder for root, dirnames, filenames in os.walk(folder): ignore_files.extend(fnmatch.filter([os.path.join(root, filename) for filename in filenames], '*%s.ignore' % tag)) - - # Match all found ignore files with the tag_files and return True found + + # Match all found ignore files with the tag_files and return True found for tag_file in tag_files: ignore_file = fnmatch.filter(ignore_files, '%s.%s.ignore' % (os.path.splitext(tag_file)[0], tag if tag else '*')) if ignore_file: