Now only deletes the files in trash

This commit is contained in:
2017-03-05 17:09:54 +01:00
parent e3af744679
commit 07589d6c2b

View File

@@ -3,7 +3,7 @@
# @Author: KevinMidboe
# @Date: 2017-03-05 13:52:45
# @Last Modified by: KevinMidboe
# @Last Modified time: 2017-03-05 17:07:44
# @Last Modified time: 2017-03-05 17:09:29
import sqlite3, json, os, tweepy
from re import sub
@@ -99,7 +99,10 @@ def moveFiles(episode):
os.rename(old_location, new_location)
# shutil.rmtree(showDir + episode['original'])
os.remove(showDir + episode['original'] + '/*')
if episode['trash']:
for trash in episode['trash']:
os.remove(showDir + episode['original'] + trash)
os.rmdir(showDir + episode['original'])
updateMovedStatus(episode)