mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-26 06:20:23 +00:00
#630 add custom_repo
This commit is contained in:
parent
e9950b4eca
commit
35de31e0a4
3 changed files with 11 additions and 3 deletions
|
@ -289,8 +289,10 @@ class ConfigFile:
|
||||||
"ignore_imdb_ids": check_for_attribute(self.data, "ignore_imdb_ids", parent="settings", var_type="list", default_is_none=True),
|
"ignore_imdb_ids": check_for_attribute(self.data, "ignore_imdb_ids", parent="settings", var_type="list", default_is_none=True),
|
||||||
"playlist_sync_to_users": check_for_attribute(self.data, "playlist_sync_to_users", parent="settings", default="all", default_is_none=True),
|
"playlist_sync_to_users": check_for_attribute(self.data, "playlist_sync_to_users", parent="settings", default="all", default_is_none=True),
|
||||||
"verify_ssl": check_for_attribute(self.data, "verify_ssl", parent="settings", var_type="bool", default=True),
|
"verify_ssl": check_for_attribute(self.data, "verify_ssl", parent="settings", var_type="bool", default=True),
|
||||||
|
"custom_repo": check_for_attribute(self.data, "custom_repo", parent="settings", default_is_none=True),
|
||||||
"assets_for_all": check_for_attribute(self.data, "assets_for_all", parent="settings", var_type="bool", default=False, save=False, do_print=False)
|
"assets_for_all": check_for_attribute(self.data, "assets_for_all", parent="settings", var_type="bool", default=False, save=False, do_print=False)
|
||||||
}
|
}
|
||||||
|
self.custom_repo = self.general["custom_repo"]
|
||||||
|
|
||||||
self.session = requests.Session()
|
self.session = requests.Session()
|
||||||
if not self.general["verify_ssl"]:
|
if not self.general["verify_ssl"]:
|
||||||
|
@ -447,6 +449,9 @@ class ConfigFile:
|
||||||
git = check_dict("git")
|
git = check_dict("git")
|
||||||
if git:
|
if git:
|
||||||
playlists_pairs.append(("Git", git))
|
playlists_pairs.append(("Git", git))
|
||||||
|
repo = check_dict("repo")
|
||||||
|
if repo:
|
||||||
|
playlists_pairs.append(("Repo", repo))
|
||||||
file = check_dict("file")
|
file = check_dict("file")
|
||||||
if file:
|
if file:
|
||||||
playlists_pairs.append(("File", file))
|
playlists_pairs.append(("File", file))
|
||||||
|
@ -727,6 +732,7 @@ class ConfigFile:
|
||||||
params["metadata_path"].append((name, path[attr]))
|
params["metadata_path"].append((name, path[attr]))
|
||||||
check_dict("url", "URL")
|
check_dict("url", "URL")
|
||||||
check_dict("git", "Git")
|
check_dict("git", "Git")
|
||||||
|
check_dict("repo", "Repo")
|
||||||
check_dict("file", "File")
|
check_dict("file", "File")
|
||||||
check_dict("folder", "Folder")
|
check_dict("folder", "Folder")
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -65,8 +65,10 @@ class DataFile:
|
||||||
|
|
||||||
def load_file(self):
|
def load_file(self):
|
||||||
try:
|
try:
|
||||||
if self.type in ["URL", "Git"]:
|
if self.type in ["URL", "Git", "Repo"]:
|
||||||
content_path = self.path if self.type == "URL" else f"{github_base}{self.path}.yml"
|
if self.type == "Repo" and not self.config.custom_repo:
|
||||||
|
raise Failed("Config Error: No custom_repo defined")
|
||||||
|
content_path = self.path if self.type == "URL" else f"{self.config.custom_repo if self.type == 'Repo' else github_base}{self.path}.yml"
|
||||||
response = self.config.get(content_path)
|
response = self.config.get(content_path)
|
||||||
if response.status_code >= 400:
|
if response.status_code >= 400:
|
||||||
raise Failed(f"URL Error: No file found at {content_path}")
|
raise Failed(f"URL Error: No file found at {content_path}")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
PlexAPI==4.9.0
|
PlexAPI==4.9.1
|
||||||
tmdbapis==0.1.8
|
tmdbapis==0.1.8
|
||||||
arrapi==1.3.0
|
arrapi==1.3.0
|
||||||
lxml==4.7.1
|
lxml==4.7.1
|
||||||
|
|
Loading…
Reference in a new issue