From a7d367c93b308db71dadd8d493d7d1124d0ec751 Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 20 Apr 2014 21:13:36 -0700 Subject: [PATCH] Extraction now takes place after linking is done in destination folder. --- TorrentToMedia.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 2f075cf9..0955b519 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -32,11 +32,7 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID, logger.debug("Determined Directory: %s | Name: %s | Category: %s" % (inputDirectory, inputName, inputCategory)) section = nzbtomedia.CFG.findsection(inputCategory) - if section: - if nzbtomedia.CFG[section][inputCategory]['extract']: - logger.debug('Checking for archives to extract in directory: %s' % (inputDirectory)) - extractFiles(inputDirectory) - else: + if not section: logger.error( "We could not find a section with containing a download category labeled %s in your autoProcessMedia.cfg, Exiting!" % inputCategory) return -1 @@ -122,6 +118,10 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID, if platform.system() == 'Windows': # remove Read Only flag from files in Windows. remove_read_only(outputDestination) + if nzbtomedia.CFG[section][inputCategory]['extract']: + logger.debug('Checking for archives to extract in directory: %s' % (outputDestination)) + extractFiles(outputDestination) + # Now check if video files exist in destination: if nzbtomedia.CFG["SickBeard","NzbDrone", "CouchPotato"][inputCategory]: for outputFile in listMediaFiles(outputDestination):