added season_folder attribute #62

pull/76/head
meisnate12 4 years ago
parent b30f8182be
commit 6b13d713bf

@ -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"]["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"]["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"]["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["sonarr"]["tag"] = check_for_attribute(self.data, "tag", parent="sonarr", var_type="lower_list", default_is_none=True)
self.general["tautulli"] = {} 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["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["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["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) 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)) library.add_Sonarr(SonarrAPI(self.TVDb, sonarr_params, library.Plex.language))
except Failed as e: except Failed as e:

@ -36,6 +36,7 @@ class SonarrAPI:
self.root_folder_path = params["root_folder_path"] self.root_folder_path = params["root_folder_path"]
self.add = params["add"] self.add = params["add"]
self.search = params["search"] self.search = params["search"]
self.season_folder = params["season_folder"]
self.tag = params["tag"] self.tag = params["tag"]
def add_tvdb(self, tvdb_ids, tag=None): def add_tvdb(self, tvdb_ids, tag=None):
@ -71,7 +72,7 @@ class SonarrAPI:
"titleslug": titleslug, "titleslug": titleslug,
"language": self.language, "language": self.language,
"monitored": True, "monitored": True,
"seasonFolder": True, "seasonFolder": self.season_folder,
"rootFolderPath": self.root_folder_path, "rootFolderPath": self.root_folder_path,
"seasons": [], "seasons": [],
"images": [{"covertype": "poster", "url": show.poster_path}], "images": [{"covertype": "poster", "url": show.poster_path}],

Loading…
Cancel
Save