Browse Source

Change prevent post processing under a parent (or show root) folder.

tags/release_0.19.2^2
Prinz23 6 years ago
committed by JackDandy
parent
commit
c44d580555
  1. 7
      CHANGES.md
  2. 25
      sickbeard/processTV.py

7
CHANGES.md

@ -1,4 +1,9 @@
### 0.19.1 (2019-06-06 00:00:00 UTC) ### 0.19.2 (2019-06-07 11:55:00 UTC)
Change prevent post processing under a parent (or show root) folder
### 0.19.1 (2019-06-06 00:00:00 UTC)
* Change ignore word "Spanish" to not match Spanish Princess * Change ignore word "Spanish" to not match Spanish Princess
* Remove BeyondHD torrent provider (API nuked) * Remove BeyondHD torrent provider (API nuked)

25
sickbeard/processTV.py

@ -243,6 +243,11 @@ class ProcessTVShow(object):
u'you fill out your completed TV download folder in the PP config.') u'you fill out your completed TV download folder in the PP config.')
return self.result return self.result
for path in sickbeard.ROOT_DIRS.split('|')[1:]:
if dir_name.startswith(ek.ek(os.path.realpath, path)):
self._log_helper('Dir is subdir of show root dir: %s, not processing.' % path)
return self.result
if dir_name == sickbeard.TV_DOWNLOAD_DIR: if dir_name == sickbeard.TV_DOWNLOAD_DIR:
self.is_basedir = True self.is_basedir = True
@ -332,6 +337,7 @@ class ProcessTVShow(object):
(ex(e), e.filename and (' (file %s)' % e.filename) or ''), logger.WARNING) (ex(e), e.filename and (' (file %s)' % e.filename) or ''), logger.WARNING)
# Process video files in TV subdirectories # Process video files in TV subdirectories
root_show_dirs = [ek.ek(os.path.realpath, rp) for rp in sickbeard.ROOT_DIRS.split('|')[1:]]
for directory in [x for x in dirs if self._validate_dir( for directory in [x for x in dirs if self._validate_dir(
path, x, nzb_name_original, failed, path, x, nzb_name_original, failed,
showObj=self.showObj_helper(showObj, dir_name, x, nzb_name, pp_type))]: showObj=self.showObj_helper(showObj, dir_name, x, nzb_name, pp_type))]:
@ -344,6 +350,15 @@ class ProcessTVShow(object):
self._log_helper(u'Found temporary sync files, skipping post process', logger.ERROR) self._log_helper(u'Found temporary sync files, skipping post process', logger.ERROR)
return self.result return self.result
is_sub = False
for r_path in root_show_dirs:
if walk_path.startswith(ek.ek(os.path.realpath, r_path)):
self._log_helper('Dir is subdir of show root dir: %s, not processing.' % r_path)
is_sub = True
break
if is_sub:
continue
# Ignore any symlinks at this stage to avoid the potential for unraring a symlinked archive # Ignore any symlinks at this stage to avoid the potential for unraring a symlinked archive
files = [x for x in files if not helpers.is_link(ek.ek(os.path.join, walk_path, x))] files = [x for x in files if not helpers.is_link(ek.ek(os.path.join, walk_path, x))]
@ -850,6 +865,7 @@ class ProcessTVShow(object):
use_trash=False, showObj=None): use_trash=False, showObj=None):
processor = None processor = None
root_show_dirs = [ek.ek(os.path.realpath, rp) for rp in sickbeard.ROOT_DIRS.split('|')[1:]]
for cur_video_file in video_files: for cur_video_file in video_files:
if self._already_postprocessed(process_path, cur_video_file, force): if self._already_postprocessed(process_path, cur_video_file, force):
@ -858,6 +874,15 @@ class ProcessTVShow(object):
cur_video_file_path = ek.ek(os.path.join, process_path, cur_video_file) cur_video_file_path = ek.ek(os.path.join, process_path, cur_video_file)
is_sub = False
for r_path in root_show_dirs:
if cur_video_file_path.startswith(r_path):
self._log_helper('Dir is subdir of show root dir: %s, not processing.' % r_path)
is_sub = True
break
if is_sub:
continue
try: try:
processor = postProcessor.PostProcessor( processor = postProcessor.PostProcessor(
cur_video_file_path, nzb_name, process_method, force_replace, cur_video_file_path, nzb_name, process_method, force_replace,

Loading…
Cancel
Save