From 6b13d713bf9271d034c07534d9cc668b756fe88b Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Mon, 1 Mar 2021 17:25:38 -0500 Subject: [PATCH] added season_folder attribute #62 --- modules/config.py | 2 ++ modules/sonarr.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/config.py b/modules/config.py index 945e8a73..30cff594 100644 --- a/modules/config.py +++ b/modules/config.py @@ -236,6 +236,7 @@ class Config: self.general["sonarr"]["root_folder_path"] = check_for_attribute(self.data, "root_folder_path", parent="sonarr", default_is_none=True) self.general["sonarr"]["add"] = check_for_attribute(self.data, "add", parent="sonarr", var_type="bool", default=False) self.general["sonarr"]["search"] = check_for_attribute(self.data, "search", parent="sonarr", var_type="bool", default=False) + self.general["sonarr"]["season_folder"] = check_for_attribute(self.data, "season_folder", parent="sonarr", var_type="bool", default=True) self.general["sonarr"]["tag"] = check_for_attribute(self.data, "tag", parent="sonarr", var_type="lower_list", default_is_none=True) self.general["tautulli"] = {} @@ -307,6 +308,7 @@ class Config: sonarr_params["root_folder_path"] = check_for_attribute(libs[lib], "root_folder_path", parent="sonarr", default=self.general["sonarr"]["root_folder_path"], req_default=True, save=False) sonarr_params["add"] = check_for_attribute(libs[lib], "add", parent="sonarr", var_type="bool", default=self.general["sonarr"]["add"], save=False) sonarr_params["search"] = check_for_attribute(libs[lib], "search", parent="sonarr", var_type="bool", default=self.general["sonarr"]["search"], save=False) + sonarr_params["season_folder"] = check_for_attribute(libs[lib], "season_folder", parent="sonarr", var_type="bool", default=self.general["sonarr"]["season_folder"], save=False) sonarr_params["tag"] = check_for_attribute(libs[lib], "search", parent="sonarr", var_type="lower_list", default=self.general["sonarr"]["tag"], default_is_none=True, save=False) library.add_Sonarr(SonarrAPI(self.TVDb, sonarr_params, library.Plex.language)) except Failed as e: diff --git a/modules/sonarr.py b/modules/sonarr.py index a99ad042..a2c29bd3 100644 --- a/modules/sonarr.py +++ b/modules/sonarr.py @@ -36,6 +36,7 @@ class SonarrAPI: self.root_folder_path = params["root_folder_path"] self.add = params["add"] self.search = params["search"] + self.season_folder = params["season_folder"] self.tag = params["tag"] def add_tvdb(self, tvdb_ids, tag=None): @@ -71,7 +72,7 @@ class SonarrAPI: "titleslug": titleslug, "language": self.language, "monitored": True, - "seasonFolder": True, + "seasonFolder": self.season_folder, "rootFolderPath": self.root_folder_path, "seasons": [], "images": [{"covertype": "poster", "url": show.poster_path}],