Skip to content

Commit

Permalink
remove pause file after every render
Browse files Browse the repository at this point in the history
  • Loading branch information
TNTwise committed Sep 15, 2024
1 parent 77dc12a commit 0f1b76b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions REAL-Video-Enhancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
videosPath,
checkForWritePermissions,
getAvailableDiskSpace,
removeFile,
)
from src.ui.ProcessTab import ProcessTab
from src.ui.DownloadTab import DownloadTab
Expand Down
1 change: 1 addition & 0 deletions backend/src/FFmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,4 +394,5 @@ def writeOutVideoFrames(self):

renderTime = time.time() - self.startTime
self.writingDone = True

printAndLog(f"\nTime to complete render: {round(renderTime, 2)}")
5 changes: 3 additions & 2 deletions backend/src/RenderVideo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from .FFmpeg import FFMpegRender
from .SceneDetect import SceneDetect
from .Util import printAndLog, log
from .Util import printAndLog, log, removeFile
from .NPMean import NPMeanSequential

# try/except imports
Expand Down Expand Up @@ -177,6 +177,7 @@ def renderUpscale(self):
else:
sleep(1)
self.writeQueue.put(None)
removeFile(self.pausedFile)
log("Finished Upscale")

def renderInterpolate(self):
Expand Down Expand Up @@ -243,7 +244,7 @@ def renderInterpolate(self):
frameNum+=1
else:
sleep(1)

removeFile(self.pausedFile)
self.writeQueue.put(None)
log("Finished Interpolation")

Expand Down
6 changes: 5 additions & 1 deletion backend/src/Util.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ def isFlatpak():
cwd = os.getcwd()
with open(os.path.join(cwd, "backend_log.txt"), "w") as f:
pass

def removeFile(file):
try:
os.remove(file)
except:
print("Failed to remove file!")

def warnAndLog(message: str):
warnings.warn(message)
Expand Down
5 changes: 4 additions & 1 deletion src/Util.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ def currentDirectory():


def removeFile(file):
os.remove(file)
try:
os.remove(file)
except:
print("Failed to remove file!")


def checkIfDeps() -> bool:
Expand Down

0 comments on commit 0f1b76b

Please sign in to comment.