From e107737d5bd9051925dc78a90c690ab4850db33c Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Sat, 28 Jan 2023 20:57:52 -0700 Subject: [PATCH] Update subgen.py Don't run again if there's already a wav file in the works. (Don't double process an event) --- subgen/subgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subgen/subgen.py b/subgen/subgen.py index 51e237a..987b980 100644 --- a/subgen/subgen.py +++ b/subgen/subgen.py @@ -40,7 +40,7 @@ def process_post_request(request, *args, **kwargs): print("file name with no extension: " + filenamenoextension) print("event: " + event) - if ((procaddedmedia and event == "added") or (procmediaonplay and event == "played")) and (len(glob.glob("{}/{}*subgen*".format(filepath, filenamenoextension))) == 0): #glob nonsense checks if there exists a subgen file already and won't make a new one + if ((procaddedmedia and event == "added") or (procmediaonplay and event == "played")) and (len(glob.glob("{}/{}*subgen*".format(filepath, filenamenoextension))) == 0) and not os.path.isfile("{}.output.wav".format(fullpath)): #glob nonsense checks if there exists a subgen file already and won't make a new one if os.getenv('WHISPER_SPEEDUP') == "True" : print("This is a speedup run!") finalsubname = "{0}/{1}.subgen.{2}.speedup.{3}".format(