[19] fix version name

This commit is contained in:
meisnate12 2023-01-24 09:29:25 -05:00
parent 96c937a79f
commit 28c41fe784
4 changed files with 13 additions and 12 deletions

View file

@ -1 +1 @@
1.18.3-develop18
1.18.3-develop19

View file

@ -114,7 +114,7 @@ class ConfigFile:
self.default_dir = default_dir
self.read_only = attrs["read_only"] if "read_only" in attrs else False
self.version = attrs["version"] if "version" in attrs else None
self.env_version = attrs["env_version"] if "env_version" in attrs else None
self.branch = attrs["branch"] if "branch" in attrs else None
self.no_missing = attrs["no_missing"] if "no_missing" in attrs else None
self.no_report = attrs["no_report"] if "no_report" in attrs else None
self.ignore_schedules = attrs["ignore_schedules"] if "ignore_schedules" in attrs else False
@ -133,7 +133,7 @@ class ConfigFile:
with open(self.config_path, encoding="utf-8") as fp:
logger.separator("Redacted Config", space=False, border=False, debug=True)
for line in fp.readlines():
logger.debug(re.sub(r"(token|client.*|url|api_*key|secret|webhooks|error|run_start|run_end|version|changes|username|password): .+", r"\1: (redacted)", line.strip("\r\n")))
logger.debug(re.sub(r"(token|client.*|url|api_*key|secret|error|run_start|run_end|version|changes|username|password): .+", r"\1: (redacted)", line.strip("\r\n")))
logger.debug("")
self.data = YAML(self.config_path).data
@ -386,7 +386,7 @@ class ConfigFile:
repo = repo.replace("https://github.com/", "https://raw.githubusercontent.com/").replace("/tree/", "/")
self.custom_repo = repo
self.check_nightly = self.general["check_nightly"]
self.latest_version = util.current_version(self.version, env_version=self.env_version, nightly=self.check_nightly)
self.latest_version = util.current_version(self.version, branch=self.branch, nightly=self.check_nightly)
self.session = requests.Session()
if not self.general["verify_ssl"]:

View file

@ -117,10 +117,10 @@ def guess_branch(version, env_version, git_branch):
else:
return "master"
def current_version(version, env_version=None, nightly=False):
if nightly or env_version == "nightly":
def current_version(version, branch=None, nightly=False):
if nightly or branch == "nightly":
return get_nightly()
elif env_version == "develop":
elif branch == "develop":
return get_develop()
elif version[2] > 0:
new_version = get_develop()
@ -154,12 +154,13 @@ def get_master():
def get_version(level):
try:
url = f"https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager/{level}/VERSION"
return parse_version(requests.get(url).content.decode().strip())
return parse_version(requests.get(url).content.decode().strip(), text=level)
except requests.exceptions.ConnectionError:
return "Unknown", "Unknown", 0
def parse_version(version):
split_version = version.split("-develop")
def parse_version(version, text="develop"):
version = version.replace("develop", text)
split_version = version.split(f"-{text}")
return version, split_version[0], int(split_version[1]) if len(split_version) > 1 else 0
def download_image(title, image_url, download_directory, filename):

View file

@ -206,7 +206,7 @@ def start(attrs):
logger.info_center(" |___/ ")
system_ver = "Docker" if is_docker else "Linuxserver" if is_linuxserver else f"Python {platform.python_version()}"
logger.info(f" Version: {version[0]} ({system_ver}){f' (Git: {git_branch})' if git_branch else ''}")
latest_version = util.current_version(version, env_version=env_version)
latest_version = util.current_version(version, branch=branch)
new_version = latest_version[0] if latest_version and (version[1] != latest_version[1] or (version[2] and version[2] < latest_version[2])) else None
if new_version:
logger.info(f" Newest Version: {new_version}")
@ -223,7 +223,7 @@ def start(attrs):
attrs["time_obj"] = start_time
attrs["read_only"] = read_only_config
attrs["version"] = version
attrs["env_version"] = env_version
attrs["branch"] = branch
attrs["no_missing"] = no_missing
attrs["no_report"] = no_report
attrs["collection_only"] = collection_only