diff --git a/CHANGES.md b/CHANGES.md index 66538dfa..c7b2e7c2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -62,6 +62,7 @@ * Change prevent duplicate show ids from presenting items on 'Add from... Browse Shows' * Change add 'nocache' kwarg to helpers.getURL to facilitate non-cached requests * Change instantly use saved value from Search Settings/Episode Search/"Check propers every" instead of after a restart +* Change include OSError system messages in file system failure logs during post process ### 0.11.11 (2016-04-05 19:20:00 UTC) diff --git a/sickbeard/postProcessor.py b/sickbeard/postProcessor.py index d1c2ac6a..3eca751a 100644 --- a/sickbeard/postProcessor.py +++ b/sickbeard/postProcessor.py @@ -448,6 +448,9 @@ class PostProcessor(object): self.in_history = True show = helpers.findCertainShow(sickbeard.showList, indexer_id) to_return = (show, season, [], quality) + if not show: + self._log(u'Unknown show, check availability on ShowList page', logger.DEBUG) + break self._log(u'Found a match in history for %s' % show.name, logger.DEBUG) break diff --git a/sickbeard/processTV.py b/sickbeard/processTV.py index a7d453ec..cad134fb 100644 --- a/sickbeard/processTV.py +++ b/sickbeard/processTV.py @@ -225,18 +225,23 @@ class ProcessTVShow(object): else: video_batch = video_files - while 0 < len(video_batch): - video_pick = [''] - video_size = 0 - for cur_video_file in video_batch: - cur_video_size = ek.ek(os.path.getsize, ek.ek(os.path.join, path, cur_video_file)) - if 0 == video_size or cur_video_size > video_size: - video_size = cur_video_size - video_pick = [cur_video_file] + try: + while 0 < len(video_batch): + video_pick = [''] + video_size = 0 + for cur_video_file in video_batch: + cur_video_size = ek.ek(os.path.getsize, ek.ek(os.path.join, path, cur_video_file)) + if 0 == video_size or cur_video_size > video_size: + video_size = cur_video_size + video_pick = [cur_video_file] - video_batch = set(video_batch) - set(video_pick) + video_batch = set(video_batch) - set(video_pick) - self._process_media(path, video_pick, nzb_name, process_method, force, force_replace, use_trash=cleanup) + self._process_media(path, video_pick, nzb_name, process_method, force, force_replace, use_trash=cleanup) + + except OSError as e: + logger.log('Batch skipped, %s%s' % + (ex(e), e.filename and (' (file %s)' % e.filename) or ''), logger.WARNING) # Process video files in TV subdirectories for directory in [x for x in dirs if self._validate_dir(path, x, nzb_name_original, failed)]: @@ -266,18 +271,24 @@ class ProcessTVShow(object): else: video_batch = video_files - while 0 < len(video_batch): - video_pick = [''] - video_size = 0 - for cur_video_file in video_batch: - cur_video_size = ek.ek(os.path.getsize, ek.ek(os.path.join, process_path, cur_video_file)) - if 0 == video_size or cur_video_size > video_size: - video_size = cur_video_size - video_pick = [cur_video_file] + try: + while 0 < len(video_batch): + video_pick = [''] + video_size = 0 + for cur_video_file in video_batch: + cur_video_size = ek.ek(os.path.getsize, ek.ek(os.path.join, process_path, cur_video_file)) - video_batch = set(video_batch) - set(video_pick) + if 0 == video_size or cur_video_size > video_size: + video_size = cur_video_size + video_pick = [cur_video_file] - self._process_media(process_path, video_pick, nzb_name, process_method, force, force_replace, use_trash=cleanup) + video_batch = set(video_batch) - set(video_pick) + + self._process_media(process_path, video_pick, nzb_name, process_method, force, force_replace, use_trash=cleanup) + + except OSError as e: + logger.log('Batch skipped, %s%s' % + (ex(e), e.filename and (' (file %s)' % e.filename) or ''), logger.WARNING) if process_method in ('hardlink', 'symlink') and video_in_rar: self._delete_files(process_path, rar_content)