From fa334e685126292d80fec38e96312a8cc410c993 Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Tue, 11 Apr 2017 20:16:46 +0930 Subject: [PATCH] add check to exception rename to not over-write exisiting. Fixes #1238 --- core/nzbToMediaSceneExceptions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/nzbToMediaSceneExceptions.py b/core/nzbToMediaSceneExceptions.py index 71ac28b2..3607797b 100644 --- a/core/nzbToMediaSceneExceptions.py +++ b/core/nzbToMediaSceneExceptions.py @@ -61,6 +61,8 @@ def strip_groups(filename): def rename_file(filename, newfilePath): + if os.path.isfile(newfilePath): + newfilePath = os.path.splitext(newfilePath)[0] + ".NTM" + os.path.splitext(newfilePath)[1] logger.debug("Replacing file name {old} with download name {new}".format (old=filename, new=newfilePath), "EXCEPTION") try: