diff --git a/tdarr_inform.py b/tdarr_inform.py index 37144f9..4659d8f 100644 --- a/tdarr_inform.py +++ b/tdarr_inform.py @@ -41,8 +41,13 @@ def main(): arr_event_type = os.environ["radarr_eventtype"] arr_file_path_key = "radarr_moviefile_path" else: - loggit("Could not Detect Radarr or Sonarr", True) - sys.exit(0) + # loggit("Could not Detect Radarr or Sonarr", True) + # sys.exit(0) + + arr_type = "sonarr" + arr_event_type = "Download" + arr_file_path_key = "sonarr_episodefile_path" + print(arr_file_path_key) loggit("tdarr_inform Recieved %s Event from %s\n" % (arr_event_type, arr_type)) @@ -50,17 +55,26 @@ def main(): sys.exit(0) elif arr_event_type not in ["Download", "Rename"]: + # TODO rename sonarr_series_path + # radarr_moviefile_paths split | + # radarr_moviefile_previouspaths + + # TODO Delete + # sonarr_series_path + # radarr_deletedpaths loggit("%s is not a supported tdarr_inform Event." % arr_event_type, True) sys.exit(0) - if arr_file_path_key not in os.environ: - loggit("%s Environment variable was missing." % arr_file_path_key, True) - sys.exit(1) - arr_file_path = os.environ[arr_file_path_key] + # if arr_file_path_key not in os.environ: + # loggit("%s Environment variable was missing." % arr_file_path_key, True) + # sys.exit(1) + # arr_file_path = os.environ[arr_file_path_key] + arr_file_path = "/Drivepool/Media/TV/Cartoons/Ben 10 (2016)/Season 2/Ben 10 (2016) - S02E31 - Chicken Nuggets of Wisdom.mkv" loggit("Found %s\n" % arr_file_path) loggit("Preparing payload to POST to tdarr API\n") + """ payload = { "data": { "scanConfig": { @@ -72,9 +86,10 @@ def main(): } } } - headers = {"content-type": "application/json"} - response = requests.post(script_settings["tdarr"]["url"], json=payload, headers=headers) - loggit("Tdarr response: %s\n" % response) + """ + # headers = {"content-type": "application/json"} + # response = requests.post(script_settings["tdarr"]["url"], json=payload, headers=headers) + # loggit("Tdarr response: %s\n" % response) if __name__ == "__main__":