From 23045c8db1239b3dc39cb439a6c7b65f07f15102 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Mon, 18 Feb 2013 16:06:46 -0800 Subject: [PATCH] remove any samples from packed --- TorrentToMedia.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 7ffd64ea..08f45f34 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -354,7 +354,11 @@ for dirpath, dirnames, filenames in os.walk(destination): file_path = os.path.join(dirpath, file) file_ext = os.path.splitext(file)[1] if file_ext in video_files: #if the file is a video file. - video2 = video2 + 1 + if is_sample(file_path, Name): + Logger.info("file %s is a sample file. Removing", file_path) + os.unlink(file_path) #remove samples + else: + video2 = video2 + 1 if video2 >= video and video2 > 0: #check that all video files were moved. status = 0