From fb666feec5e014a489f870c6fa260d0da32d2957 Mon Sep 17 00:00:00 2001 From: ninjadogz Date: Sun, 27 Oct 2019 17:35:24 +0900 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=87=8D=E5=90=8Dskip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新重名skip --- AV_Data_Capture.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/AV_Data_Capture.py b/AV_Data_Capture.py index 6ce94c1..0aec9e6 100755 --- a/AV_Data_Capture.py +++ b/AV_Data_Capture.py @@ -34,10 +34,13 @@ def moveMovies(fromPath): movieFiles = movieFiles + [os.path.join(dirpath, f) for dirpath, dirnames, files in os.walk(fromPath) for f in fnmatch.filter(files, '*.' + fm)] - print(movieFiles) for movie in movieFiles: - print("Move file " + movie) - shutil.move(movie, os.path.curdir) + movieName = movie.split('/')[-1] + print("Move file " + movieName) + if (os.path.exists(os.path.curdir + '/' + movieName)): + print(movieName + "exists, skip.") + else: + shutil.move(movie, os.path.curdir) def UpdateCheck(): if UpdateCheckSwitch() == '1': html2 = get_html('https://raw.githubusercontent.com/yoshiko2/AV_Data_Capture/master/update_check.json')