first commit

This commit is contained in:
2022-06-05 11:25:23 +07:00
commit 1d4dc3deeb
4 changed files with 225 additions and 0 deletions

31
Lidarr/delete_files.py Normal file
View File

@ -0,0 +1,31 @@
#!/usr/bin/python3
import requests
import os
import shutil
PATH_LIST = ["Music"]
lidarrBasePath = ""
lidarrSourcePath = ""
lidarrMP3Folder = ""
try:
# lidarr
lidarrEventType = os.environ.get('lidarr_eventtype')
lidarrSourcePath = os.environ.get('lidarr_moviefile_sourcepath')
# Get the folder name of the file to check if movie/serie is inside a folder or not
lidarrMP3Folder = os.path.dirname(lidarrSourcePath)
lidarrBasePath = os.path.basename(lidarrMP3Folder)
except:
print("Cannot get env variables")
if lidarrBasePath not in PATH_LIST:
try:
shutil.rmtree(lidarrMP3Folder)
except:
pass