From 291be93382e2069edc9c3390079a7d6353df03ab Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Thu, 26 Jun 2014 06:05:36 -0400 Subject: [PATCH] Fix a bug where SickRage won't process failed downloads because the directory doesn't exist --- nzbtomedia/autoProcess/autoProcessTV.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nzbtomedia/autoProcess/autoProcessTV.py b/nzbtomedia/autoProcess/autoProcessTV.py index 4e002fb0..46907bc2 100644 --- a/nzbtomedia/autoProcess/autoProcessTV.py +++ b/nzbtomedia/autoProcess/autoProcessTV.py @@ -85,6 +85,16 @@ class autoProcessTV: if os.path.isdir(SpecificPath): dirName = SpecificPath + # Attempt to create the directory if it doesn't exist and ignore any + # error stating that it already exists. This fixes a bug where SickRage + # won't process the directory because it doesn't exist. + try: + os.makedirs(dirName) # Attempt to create the directory + except OSError, e: + # Re-raise the error if it wasn't about the directory not existing + if exception.errno != errno.EEXIST: + raise + # Check video files for corruption status = int(failed) good_files = 0