From 9018d5a585f2c22e9f86195de48d4bc81f24a570 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 10 Jun 2012 21:37:39 +0200 Subject: [PATCH] Get create and modified date to check if unpacking. fix #325 --- couchpotato/core/plugins/scanner/main.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/couchpotato/core/plugins/scanner/main.py b/couchpotato/core/plugins/scanner/main.py index b710464..f122f4b 100644 --- a/couchpotato/core/plugins/scanner/main.py +++ b/couchpotato/core/plugins/scanner/main.py @@ -296,13 +296,22 @@ class Scanner(Plugin): # Check if movie is fresh and maybe still unpacking, ignore files new then 1 minute file_too_new = False for cur_file in group['unsorted_files']: - file_time = os.path.getmtime(cur_file) - if file_time > time.time() - 60: - file_too_new = tryInt(time.time() - file_time) + file_time = [os.path.getmtime(cur_file), os.path.getctime(cur_file)] + for t in file_time: + if t > time.time() - 60: + file_too_new = tryInt(time.time() - t) + break + + if file_too_new: break if file_too_new: - log.info('Files seem to be still unpacking or just unpacked (created on %s), ignoring for now: %s' % (time.ctime(file_time), identifier)) + log.info('Files seem to be still unpacking or just unpacked (created on %s), ignoring for now: %s' % (time.ctime(file_time[0]), identifier)) + + # Delete the unsorted list + del group['unsorted_files'] + + continue continue # Group extra (and easy) files first