From 9f947dc111d38aa1c7e8ed783a0c38e7414bb117 Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Sat, 12 Jul 2014 08:07:03 +0930 Subject: [PATCH] exit success if all files processed. Fixes https://github.com/RuudBurger/CouchPotatoServer/issues/3611 --- nzbtomedia/autoProcess/autoProcessMovie.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nzbtomedia/autoProcess/autoProcessMovie.py b/nzbtomedia/autoProcess/autoProcessMovie.py index ac120f8d..dc22377c 100644 --- a/nzbtomedia/autoProcess/autoProcessMovie.py +++ b/nzbtomedia/autoProcess/autoProcessMovie.py @@ -312,6 +312,15 @@ class autoProcessMovie: return 0 # success except: pass + if not os.path.isdir(dirName): + logger.postprocess("SUCCESS: Input Directory [%s] has been processed and removed" % ( + dirName), section) + return 0 + + elif not listMediaFiles(dirName, media=True, audio=False, meta=False, archives=True): + logger.postprocess("SUCCESS: Input Directory [%s] has no remaining media files. This has been fully processed." % ( + dirName), section) + return 0 # pause and let CouchPotatoServer catch its breath time.sleep(10 * wait_for)