Now trash iterates over json object not string of trash

This commit is contained in:
2017-03-05 17:12:24 +01:00
parent 07589d6c2b
commit e014b32511

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:09:29
# @Last Modified time: 2017-03-05 17:11:57
import sqlite3, json, os, tweepy
from re import sub
@@ -100,7 +100,7 @@ def moveFiles(episode):
# shutil.rmtree(showDir + episode['original'])
if episode['trash']:
for trash in episode['trash']:
for trash in json.loads(episode['trash']):
os.remove(showDir + episode['original'] + trash)
os.rmdir(showDir + episode['original'])