From 2bcbc5816f8c4e1177d8dd0120a5489adf461852 Mon Sep 17 00:00:00 2001 From: Bryce Chidester Date: Sun, 11 Nov 2012 12:22:21 -0700 Subject: [PATCH] Prevent double-processing of downloads when the SabNzbd and Torrent download directories are the same. --- headphones/postprocessor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index dfacb9ff..bd525781 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -801,6 +801,9 @@ def forcePostProcess(): if headphones.DOWNLOAD_TORRENT_DIR: download_dirs.append(headphones.DOWNLOAD_TORRENT_DIR.encode(headphones.SYS_ENCODING, 'replace')) + # If DOWNLOAD_DIR and DOWNLOAD_TORRENT_DIR are the same, remove the duplicate to prevent us from trying to process the same folder twice. + download_dirs = list(set(download_dirs)) + logger.info('Checking to see if there are any folders to process in download_dir(s): %s' % str(download_dirs).decode(headphones.SYS_ENCODING, 'replace')) # Get a list of folders in the download_dir folders = []