feat: add language_profile_id option for sonarr

pull/160/head
Joris 4 years ago
parent e72979e687
commit ecfc3c378e

@ -258,6 +258,7 @@ class Config:
self.general["sonarr"]["version"] = check_for_attribute(self.data, "version", parent="sonarr", test_list=["v2", "v3"], options=" v2 (For Sonarr 0.2)\n v3 (For Sonarr 3.0)", default="v2")
self.general["sonarr"]["quality_profile"] = check_for_attribute(self.data, "quality_profile", 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"]["language_profile_id"] = check_for_attribute(self.data, "language_profile_id", parent="sonarr", default=1)
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)
@ -358,6 +359,7 @@ class Config:
sonarr_params["version"] = check_for_attribute(lib, "version", parent="sonarr", test_list=["v2", "v3"], options=" v2 (For Sonarr 0.2)\n v3 (For Sonarr 3.0)", default=self.general["sonarr"]["version"], save=False)
sonarr_params["quality_profile"] = check_for_attribute(lib, "quality_profile", parent="sonarr", default=self.general["sonarr"]["quality_profile"], req_default=True, save=False)
sonarr_params["root_folder_path"] = check_for_attribute(lib, "root_folder_path", parent="sonarr", default=self.general["sonarr"]["root_folder_path"], req_default=True, save=False)
sonarr_params["language_profile_id"] = check_for_attribute(lib, "language_profile_id", parent="sonarr", default=self.general["sonarr"]["language_profile_id"], save=False)
sonarr_params["add"] = check_for_attribute(lib, "add", parent="sonarr", var_type="bool", default=self.general["sonarr"]["add"], save=False)
sonarr_params["search"] = check_for_attribute(lib, "search", parent="sonarr", var_type="bool", default=self.general["sonarr"]["search"], save=False)
sonarr_params["season_folder"] = check_for_attribute(lib, "season_folder", parent="sonarr", var_type="bool", default=self.general["sonarr"]["season_folder"], save=False)

@ -34,6 +34,7 @@ class SonarrAPI:
self.version = params["version"]
self.token = params["token"]
self.root_folder_path = params["root_folder_path"]
self.language_profile_id = params["language_profile_id"]
self.add = params["add"]
self.search = params["search"]
self.season_folder = params["season_folder"]
@ -67,7 +68,7 @@ class SonarrAPI:
url_json = {
"title": show.title,
f"{'qualityProfileId' if self.version == 'v3' else 'profileId'}": self.quality_profile_id,
"languageProfileId": 1,
"languageProfileId": self.language_profile_id,
"tvdbId": int(tvdb_id),
"titleslug": titleslug,
"language": self.language,

Loading…
Cancel
Save