Now uses os.remove and os.rmdir instead of shutil that removes everything

This commit is contained in:
2017-03-05 17:08:14 +01:00
parent fed2d94724
commit e3af744679

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:01:42
# @Last Modified time: 2017-03-05 17:07:44
import sqlite3, json, os, tweepy
from re import sub
@@ -98,7 +98,9 @@ def moveFiles(episode):
new_location = showDir + seasonFormat + episodeFormat + item[1]
os.rename(old_location, new_location)
shutil.rmtree(showDir + episode['original'])
# shutil.rmtree(showDir + episode['original'])
os.remove(showDir + episode['original'] + '/*')
os.rmdir(showDir + episode['original'])
updateMovedStatus(episode)