From 4a17f3606788263bbc966be8ec5388c159d64211 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Sun, 25 Sep 2022 14:43:58 -0400 Subject: [PATCH] [53] minor fixes --- VERSION | 2 +- modules/builder.py | 16 +++++++++++++--- modules/github.py | 13 ++++++------- modules/mal.py | 2 +- modules/meta.py | 7 ++++--- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/VERSION b/VERSION index fddc74db..a22057a4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.17.3-develop52 +1.17.3-develop53 diff --git a/modules/builder.py b/modules/builder.py index 49b52e3a..f54c4448 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -1631,8 +1631,12 @@ class CollectionBuilder: self.missing_shows.append(tvdb_id) elif tmdb_type == "movie" and self.do_missing and _id not in self.missing_movies: self.missing_movies.append(_id) - elif tmdb_type == "show" and self.do_missing: - tvdb_id = self.config.Convert.tmdb_to_tvdb(_id, fail=True) + elif tmdb_type in ["show", "episode"] and self.do_missing: + if tmdb_type == "episode": + tmdb_id, _, _ = _id.split("_") + else: + tmdb_id = _id + tvdb_id = self.config.Convert.tmdb_to_tvdb(tmdb_id, fail=True) if tvdb_id not in self.missing_shows: self.missing_shows.append(tvdb_id) except Failed as e: @@ -1649,13 +1653,19 @@ class CollectionBuilder: break if not found and input_id not in self.missing_movies: self.missing_movies.append(input_id) - elif id_type in ["tvdb", "tmdb_show"] and not self.parts_collection: + elif id_type in ["tvdb", "tmdb_show", "tvdb_season", "tvdb_episode"] and not self.parts_collection: if id_type == "tmdb_show": try: tvdb_id = self.config.Convert.tmdb_to_tvdb(input_id, fail=True) except Failed as e: logger.warning(e) continue + elif id_type == "tvdb_season": + tvdb_id, _ = input_id.split("_") + tvdb_id = int(tvdb_id) + elif id_type == "tvdb_episode": + tvdb_id, _, _ = input_id.split("_") + tvdb_id = int(tvdb_id) else: tvdb_id = int(input_id) if tvdb_id not in self.ignore_ids: diff --git a/modules/github.py b/modules/github.py index b7aa3a87..03b3072d 100644 --- a/modules/github.py +++ b/modules/github.py @@ -34,7 +34,7 @@ class GitHub: def config_tags(self): if not self._config_tags: try: - self._config_tags = [r["ref"][10:] for r in self.config.get_json(f"{base_url}-Configs/git/refs/tags")] + self._config_tags = [r["ref"][11:] for r in self.config.get_json(f"{base_url}-Configs/git/refs/tags")] except TypeError: pass return self._config_tags @@ -43,10 +43,9 @@ class GitHub: def configs_url(self): if self._configs_url is None: self._configs_url = f"{configs_raw_url}/master/" - if self.config.latest_version[1] != self.config.version[1]: - if self.config.version[1] in self.config_tags: - self._configs_url = f"{configs_raw_url}/{self.config.version[1]}/" - elif not self.config.check_nightly and self.config.version[2] > 0: - if util.get_develop()[2] >= self.config.version[2]: - self._configs_url = f"{configs_raw_url}/{self.config.version[1]}/" + if self.config.version[1] in self.config_tags and ( + self.config.latest_version[1] != self.config.version[1] + or (not self.config.check_nightly and 0 <= self.config.version[2] <= util.get_develop()[2]) + ): + self._configs_url = f"{configs_raw_url}/v{self.config.version[1]}/" return self._configs_url diff --git a/modules/mal.py b/modules/mal.py index 0c3991c7..25efc893 100644 --- a/modules/mal.py +++ b/modules/mal.py @@ -74,7 +74,7 @@ class MyAnimeListObj: self.score = self._data["score"] self.rank = self._data["rank"] self.popularity = self._data["popularity"] - self.genres = self._data["genres"].split("|") if cache else [g["name"] for g in self._data["genres"]] + self.genres = [] if not self._data["genres"] else self._data["genres"].split("|") if cache else [g["name"] for g in self._data["genres"]] class MyAnimeList: diff --git a/modules/meta.py b/modules/meta.py index 8949536e..93e06b5e 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -434,9 +434,9 @@ class MetadataFile(DataFile): og_exclude = util.parse("Config", "exclude", dynamic, parent=map_name, methods=methods, datatype="strlist") include = [] if "include" in self.temp_vars: - include = util.parse("Config", "include", self.temp_vars["include"], parent="template_variable", datatype="strlist") + include = [i for i in util.parse("Config", "include", self.temp_vars["include"], parent="template_variable", datatype="strlist") if i not in og_exclude] elif "include" in methods: - include = util.parse("Config", "include", dynamic, parent=map_name, methods=methods, datatype="strlist") + include = [i for i in util.parse("Config", "include", dynamic, parent=map_name, methods=methods, datatype="strlist") if i not in og_exclude] addons = util.parse("Config", "addons", dynamic, parent=map_name, methods=methods, datatype="dictliststr") if "addons" in methods else {} exclude = [str(e) for e in og_exclude] for k, v in addons.items(): @@ -708,7 +708,8 @@ class MetadataFile(DataFile): logger.debug(f"Mapping Name: {map_name}") logger.debug(f"Type: {auto_type}") logger.debug(f"Data: {dynamic_data}") - logger.debug(f"Exclude: {exclude}") + logger.debug(f"Exclude: {og_exclude}") + logger.debug(f"Exclude Final: {exclude}") logger.debug(f"Addons: {addons}") logger.debug(f"Template: {template_names}") logger.debug(f"Other Template: {other_templates}")