From ac045539d165456c4c37e2f3b8b7fcc1123483df Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 5 Apr 2013 17:51:45 +0200 Subject: [PATCH] Don't move or delete anything in status check --- couchpotato/core/downloaders/transmission/main.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/couchpotato/core/downloaders/transmission/main.py b/couchpotato/core/downloaders/transmission/main.py index 6a5aad10..8cf47380 100644 --- a/couchpotato/core/downloaders/transmission/main.py +++ b/couchpotato/core/downloaders/transmission/main.py @@ -122,30 +122,20 @@ class Transmission(Downloader): log.debug('name=%s / id=%s / downloadDir=%s / hashString=%s / percentDone=%s / status=%s / eta=%s / uploadRatio=%s / confRatio=%s / isFinished=%s', (item['name'], item['id'], item['downloadDir'], item['hashString'], item['percentDone'], item['status'], item['eta'], item['uploadRatio'], self.conf('ratio'), item['isFinished'])) if not os.path.isdir(Env.setting('from', 'renamer')): - log.debug('Renamer folder has to exist.') + log.error('Renamer "from" folder doesn\'t to exist.') return if (item['percentDone'] * 100) >= 100 and (item['status'] == 6 or item['status'] == 0) and item['uploadRatio'] > self.conf('ratio'): try: trpc.stop_torrent(item['hashString'], {}) - - if not os.path.isdir(os.path.join(item['downloadDir'], item['name'])): - raise Exception('Missing folder: %s' % os.path.join(item['downloadDir'], item['name'])) - elif item['downloadDir'].rstrip(os.path.sep) in Env.setting('from', 'renamer').rstrip(os.path.sep): - raise Exception('Transmission download folder should not be the same or in the renamer "from" folder!') - else: - log.info('Moving folder from "%s" to "%s"', (os.path.join(item['downloadDir'], item['name']), Env.setting('from', 'renamer'))) - shutil.move(os.path.join(item['downloadDir'], item['name']), Env.setting('from', 'renamer')) - statuses.append({ 'id': item['hashString'], 'name': item['name'], 'status': 'completed', 'original_status': item['status'], 'timeleft': str(timedelta(seconds = 0)), - 'folder': os.path.join(Env.setting('from', 'renamer'), item['name']), + 'folder': os.path.join(item['downloadDir'], item['name']), }) - trpc.remove_torrent(item['hashString'], True, {}) except Exception, err: log.error('Failed to stop and remove torrent "%s" with error: %s', (item['name'], err)) statuses.append({