don't include 720p or 1080p as "parts". fixes #167

This commit is contained in:
clinton-hall 2013-07-25 22:12:22 +09:30
commit b8e03b1b9d

View file

@ -98,7 +98,8 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
except: except:
Logger.exception("MAIN: Failed to link file: %s", file) Logger.exception("MAIN: Failed to link file: %s", file)
elif fileExtension in compressedContainer: elif fileExtension in compressedContainer:
if re.search(r'\d+', os.path.splitext(fileName)[1]) and os.path.dirname(filePath) in extracted_folder: # find part numbers in second "extension" from right, if we have more than 1 compressed file in the same directory. # find part numbers in second "extension" from right, if we have more than 1 compressed file in the same directory.
if re.search(r'\d+', os.path.splitext(fileName)[1]) and os.path.dirname(filePath) in extracted_folder and not (os.path.splitext(fileName)[1] in ['.720p','.1080p']):
part = int(re.search(r'\d+', os.path.splitext(fileName)[1]).group()) part = int(re.search(r'\d+', os.path.splitext(fileName)[1]).group())
if part == 1: # we only want to extract the primary part. if part == 1: # we only want to extract the primary part.
Logger.debug("MAIN: Found primary part of a multi-part archive %s. Extracting", file) Logger.debug("MAIN: Found primary part of a multi-part archive %s. Extracting", file)