Simplified is_sample

This commit is contained in:
Jon Monroe 2013-02-26 08:55:35 -05:00
commit ec6398fcb6

View file

@ -125,12 +125,10 @@ def category_search(inputDirectory, inputName, inputCategory, root, categories):
def is_sample(filePath, inputName): def is_sample(filePath, inputName):
# 200 MB in bytes # 200 MB in bytes
# Maybe let the users change this?
SIZE_CUTOFF = 200 * 1024 * 1024 SIZE_CUTOFF = 200 * 1024 * 1024
# Ignore 'sample' in files unless 'sample' in Torrent Name # Ignore 'sample' in files unless 'sample' in Torrent Name
if ('sample' in filePath.lower()) and (not 'sample' in inputName) and (os.path.getsize(filePath) < SIZE_CUTOFF): return ('sample' in filePath.lower()) and (not 'sample' in inputName) and (os.path.getsize(filePath) < SIZE_CUTOFF)
return True
else:
return False
def copy_link(source, target, useLink, outputDestination): def copy_link(source, target, useLink, outputDestination):
# Create destination folder # Create destination folder