From ec6398fcb6fc2aaffc9376c21f8e757ea32e96c9 Mon Sep 17 00:00:00 2001 From: Jon Monroe Date: Tue, 26 Feb 2013 08:55:35 -0500 Subject: [PATCH] Simplified is_sample --- TorrentToMedia.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 81b7a52f..9a5e5af3 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -125,12 +125,10 @@ def category_search(inputDirectory, inputName, inputCategory, root, categories): def is_sample(filePath, inputName): # 200 MB in bytes + # Maybe let the users change this? SIZE_CUTOFF = 200 * 1024 * 1024 # 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 True - else: - return False + return ('sample' in filePath.lower()) and (not 'sample' in inputName) and (os.path.getsize(filePath) < SIZE_CUTOFF) def copy_link(source, target, useLink, outputDestination): # Create destination folder