diff --git a/Readarr/delete_files.py b/Readarr/delete_files.py index 6d8f7ab..c2494d3 100644 --- a/Readarr/delete_files.py +++ b/Readarr/delete_files.py @@ -4,6 +4,8 @@ import os book = {} +PATH_LIST = ["EBooks"] + try: book = { "EventType": os.environ.get('readarr_eventtype'), @@ -29,14 +31,14 @@ for key, value in book.items(): f.write('\n') f.close() -# if radarrBasePath not in PATH_LIST: -# try: -# os.remove(radarrSourcePath) -# os.rmdir(radarrMovieFolder) -# except: -# pass -# else: -# try: -# os.remove(radarrSourcePath) -# except: -# pass + if radarrBasePath not in PATH_LIST: + try: + os.remove(radarrSourcePath) + os.rmdir(radarrMovieFolder) + except: + pass + else: + try: + os.remove(radarrSourcePath) + except: + pass