diff --git a/gui/slick/interfaces/default/config_postProcessing.tmpl b/gui/slick/interfaces/default/config_postProcessing.tmpl
index 43c0015a..f23f3b99 100644
--- a/gui/slick/interfaces/default/config_postProcessing.tmpl
+++ b/gui/slick/interfaces/default/config_postProcessing.tmpl
@@ -83,6 +83,13 @@
What method should be used to put file in the TV directory?
+
+
+
+ Delete RAR contents
+ Delete content of RAR files, even if Process Method not set to move?
+
+
diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py
index 0283eb5c..16b6516c 100755
--- a/sickbeard/__init__.py
+++ b/sickbeard/__init__.py
@@ -246,6 +246,7 @@ AIRDATE_EPISODES = False
PROCESS_AUTOMATICALLY = False
KEEP_PROCESSED_DIR = False
PROCESS_METHOD = None
+DELRARCONTENTS = False
MOVE_ASSOCIATED_FILES = False
POSTPONE_IF_SYNC_FILES = True
NFO_RENAME = True
@@ -526,7 +527,7 @@ def initialize(consoleLogging=True):
USE_PUSHALOT, PUSHALOT_NOTIFY_ONSNATCH, PUSHALOT_NOTIFY_ONDOWNLOAD, PUSHALOT_NOTIFY_ONSUBTITLEDOWNLOAD, PUSHALOT_AUTHORIZATIONTOKEN, \
USE_PUSHBULLET, PUSHBULLET_NOTIFY_ONSNATCH, PUSHBULLET_NOTIFY_ONDOWNLOAD, PUSHBULLET_NOTIFY_ONSUBTITLEDOWNLOAD, PUSHBULLET_API, PUSHBULLET_DEVICE, \
versionCheckScheduler, VERSION_NOTIFY, AUTO_UPDATE, NOTIFY_ON_UPDATE, PROCESS_AUTOMATICALLY, UNPACK, CPU_PRESET, \
- KEEP_PROCESSED_DIR, PROCESS_METHOD, TV_DOWNLOAD_DIR, MIN_DAILYSEARCH_FREQUENCY, DEFAULT_UPDATE_FREQUENCY, MIN_UPDATE_FREQUENCY, UPDATE_FREQUENCY, \
+ KEEP_PROCESSED_DIR, PROCESS_METHOD, DELRARCONTENTS, TV_DOWNLOAD_DIR, MIN_DAILYSEARCH_FREQUENCY, DEFAULT_UPDATE_FREQUENCY, MIN_UPDATE_FREQUENCY, UPDATE_FREQUENCY, \
showQueueScheduler, searchQueueScheduler, ROOT_DIRS, CACHE_DIR, ACTUAL_CACHE_DIR, TIMEZONE_DISPLAY, \
NAMING_PATTERN, NAMING_MULTI_EP, NAMING_ANIME_MULTI_EP, NAMING_FORCE_FOLDERS, NAMING_ABD_PATTERN, NAMING_CUSTOM_ABD, NAMING_SPORTS_PATTERN, NAMING_CUSTOM_SPORTS, NAMING_ANIME_PATTERN, NAMING_CUSTOM_ANIME, NAMING_STRIP_YEAR, \
RENAME_EPISODES, AIRDATE_EPISODES, properFinderScheduler, PROVIDER_ORDER, autoPostProcesserScheduler, \
@@ -818,6 +819,7 @@ def initialize(consoleLogging=True):
AIRDATE_EPISODES = bool(check_setting_int(CFG, 'General', 'airdate_episodes', 0))
KEEP_PROCESSED_DIR = bool(check_setting_int(CFG, 'General', 'keep_processed_dir', 1))
PROCESS_METHOD = check_setting_str(CFG, 'General', 'process_method', 'copy' if KEEP_PROCESSED_DIR else 'move')
+ DELRARCONTENTS = bool(check_setting_int(CFG, 'General', 'del_rar_contents', 0))
MOVE_ASSOCIATED_FILES = bool(check_setting_int(CFG, 'General', 'move_associated_files', 0))
POSTPONE_IF_SYNC_FILES = bool(check_setting_int(CFG, 'General', 'postpone_if_sync_files', 1))
NFO_RENAME = bool(check_setting_int(CFG, 'General', 'nfo_rename', 1))
@@ -1589,6 +1591,7 @@ def save_config():
new_config['General']['tv_download_dir'] = TV_DOWNLOAD_DIR
new_config['General']['keep_processed_dir'] = int(KEEP_PROCESSED_DIR)
new_config['General']['process_method'] = PROCESS_METHOD
+ new_config['General']['del_rar_contents'] = int(DELRARCONTENTS)
new_config['General']['move_associated_files'] = int(MOVE_ASSOCIATED_FILES)
new_config['General']['postpone_if_sync_files'] = int(POSTPONE_IF_SYNC_FILES)
new_config['General']['nfo_rename'] = int(NFO_RENAME)
diff --git a/sickbeard/processTV.py b/sickbeard/processTV.py
index a91e8721..c5c2716f 100644
--- a/sickbeard/processTV.py
+++ b/sickbeard/processTV.py
@@ -176,6 +176,11 @@ def processDir(dirName, nzbName=None, process_method=None, force=False, is_prior
delete_files(path, rarContent, result)
for video in set(videoFiles) - set(videoInRar):
result.result = process_media(path, [video], nzbName, process_method, force, is_priority, result)
+ elif sickbeard.DELRARCONTENTS and videoInRar:
+ result.result = process_media(path, videoInRar, nzbName, process_method, force, is_priority, result)
+ delete_files(path, rarContent, result)
+ for video in set(videoFiles) - set(videoInRar):
+ result.result = process_media(path, [video], nzbName, process_method, force, is_priority, result)
else:
for video in videoFiles:
result.result = process_media(path, [video], nzbName, process_method, force, is_priority, result)
@@ -207,6 +212,11 @@ def processDir(dirName, nzbName=None, process_method=None, force=False, is_prior
process_media(processPath, set(videoFiles) - set(videoInRar), nzbName, process_method, force,
is_priority, result)
delete_files(processPath, rarContent, result)
+ elif sickbeard.DELRARCONTENTS and videoInRar:
+ process_media(processPath, videoInRar, nzbName, process_method, force, is_priority, result)
+ process_media(processPath, set(videoFiles) - set(videoInRar), nzbName, process_method, force,
+ is_priority, result)
+ delete_files(processPath, rarContent, result)
else:
process_media(processPath, videoFiles, nzbName, process_method, force, is_priority, result)
diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py
index bfdd4a55..385af858 100644
--- a/sickbeard/webserve.py
+++ b/sickbeard/webserve.py
@@ -3767,7 +3767,7 @@ class ConfigPostProcessing(Config):
def savePostProcessing(self, naming_pattern=None, naming_multi_ep=None,
kodi_data=None, kodi_12plus_data=None, mediabrowser_data=None, sony_ps3_data=None,
wdtv_data=None, tivo_data=None, mede8er_data=None,
- keep_processed_dir=None, process_method=None, process_automatically=None,
+ keep_processed_dir=None, process_method=None, del_rar_contents=None, process_automatically=None,
rename_episodes=None, airdate_episodes=None, unpack=None,
move_associated_files=None, postpone_if_sync_files=None, nfo_rename=None,
tv_download_dir=None, naming_custom_abd=None,
@@ -3811,6 +3811,7 @@ class ConfigPostProcessing(Config):
sickbeard.KEEP_PROCESSED_DIR = config.checkbox_to_value(keep_processed_dir)
sickbeard.PROCESS_METHOD = process_method
+ sickbeard.DELRARCONTENTS = config.checkbox_to_value(del_rar_contents)
sickbeard.EXTRA_SCRIPTS = [x.strip() for x in extra_scripts.split('|') if x.strip()]
sickbeard.RENAME_EPISODES = config.checkbox_to_value(rename_episodes)
sickbeard.AIRDATE_EPISODES = config.checkbox_to_value(airdate_episodes)