|
|
@ -91,7 +91,7 @@ class Config:
|
|
|
|
message = "{} not found".format(text)
|
|
|
|
message = "{} not found".format(text)
|
|
|
|
if parent and save is True:
|
|
|
|
if parent and save is True:
|
|
|
|
new_config, ind, bsi = yaml.util.load_yaml_guess_indent(open(self.config_path))
|
|
|
|
new_config, ind, bsi = yaml.util.load_yaml_guess_indent(open(self.config_path))
|
|
|
|
endline = "\n| {} sub-attribute {} added to config".format(parent, attribute)
|
|
|
|
endline = "\n{} sub-attribute {} added to config".format(parent, attribute)
|
|
|
|
if parent not in new_config: new_config = {parent: {attribute: default}}
|
|
|
|
if parent not in new_config: new_config = {parent: {attribute: default}}
|
|
|
|
elif not new_config[parent]: new_config[parent] = {attribute: default}
|
|
|
|
elif not new_config[parent]: new_config[parent] = {attribute: default}
|
|
|
|
elif attribute not in new_config[parent]: new_config[parent][attribute] = default
|
|
|
|
elif attribute not in new_config[parent]: new_config[parent][attribute] = default
|
|
|
@ -214,6 +214,7 @@ class Config:
|
|
|
|
self.general["plex"] = {}
|
|
|
|
self.general["plex"] = {}
|
|
|
|
self.general["plex"]["url"] = check_for_attribute(self.data, "url", parent="plex", default_is_none=True)
|
|
|
|
self.general["plex"]["url"] = check_for_attribute(self.data, "url", parent="plex", default_is_none=True)
|
|
|
|
self.general["plex"]["token"] = check_for_attribute(self.data, "token", parent="plex", default_is_none=True)
|
|
|
|
self.general["plex"]["token"] = check_for_attribute(self.data, "token", parent="plex", default_is_none=True)
|
|
|
|
|
|
|
|
self.general["plex"]["timeout"] = check_for_attribute(self.data, "timeout", parent="plex", var_type="int", default=60)
|
|
|
|
|
|
|
|
|
|
|
|
self.general["radarr"] = {}
|
|
|
|
self.general["radarr"] = {}
|
|
|
|
self.general["radarr"]["url"] = check_for_attribute(self.data, "url", parent="radarr", default_is_none=True)
|
|
|
|
self.general["radarr"]["url"] = check_for_attribute(self.data, "url", parent="radarr", default_is_none=True)
|
|
|
@ -269,6 +270,7 @@ class Config:
|
|
|
|
params["plex"] = {}
|
|
|
|
params["plex"] = {}
|
|
|
|
params["plex"]["url"] = check_for_attribute(libs[lib], "url", parent="plex", default=self.general["plex"]["url"], req_default=True, save=False)
|
|
|
|
params["plex"]["url"] = check_for_attribute(libs[lib], "url", parent="plex", default=self.general["plex"]["url"], req_default=True, save=False)
|
|
|
|
params["plex"]["token"] = check_for_attribute(libs[lib], "token", parent="plex", default=self.general["plex"]["token"], req_default=True, save=False)
|
|
|
|
params["plex"]["token"] = check_for_attribute(libs[lib], "token", parent="plex", default=self.general["plex"]["token"], req_default=True, save=False)
|
|
|
|
|
|
|
|
params["plex"]["timeout"] = check_for_attribute(libs[lib], "timeout", parent="plex", var_type="int", default=self.general["plex"]["timeout"], save=False)
|
|
|
|
library = PlexAPI(params, self.TMDb, self.TVDb)
|
|
|
|
library = PlexAPI(params, self.TMDb, self.TVDb)
|
|
|
|
logger.info("{} Library Connection Successful".format(params["name"]))
|
|
|
|
logger.info("{} Library Connection Successful".format(params["name"]))
|
|
|
|
except Failed as e:
|
|
|
|
except Failed as e:
|
|
|
@ -334,6 +336,7 @@ class Config:
|
|
|
|
|
|
|
|
|
|
|
|
def update_libraries(self, test, requested_collections):
|
|
|
|
def update_libraries(self, test, requested_collections):
|
|
|
|
for library in self.libraries:
|
|
|
|
for library in self.libraries:
|
|
|
|
|
|
|
|
os.environ["PLEXAPI_PLEXAPI_TIMEOUT"] = str(library.timeout)
|
|
|
|
logger.info("")
|
|
|
|
logger.info("")
|
|
|
|
util.seperator("{} Library".format(library.name))
|
|
|
|
util.seperator("{} Library".format(library.name))
|
|
|
|
try: library.update_metadata(self.TMDb, test)
|
|
|
|
try: library.update_metadata(self.TMDb, test)
|
|
|
|