From 92ea349d11989d05d79fe09964754b2b00159668 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 1 Jun 2022 01:57:32 -0400 Subject: [PATCH] [12] mal genre fix --- VERSION | 2 +- modules/builder.py | 6 +++--- modules/mal.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index cc0d85f8..65268f2b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.17.0-develop11 +1.17.0-develop12 diff --git a/modules/builder.py b/modules/builder.py index 62ed1da0..b64fd181 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -1180,17 +1180,17 @@ class CollectionBuilder: final_text += f"\nStatus: {final_attributes['status']}" if "genre" in dict_methods: genre_list = util.parse(self.Type, "genre", dict_data, datatype="commalist", methods=dict_methods, parent=method_name) - final_genres = [self.config.MyAnimeList.genres[g] for g in genre_list if g in self.config.MyAnimeList.genres] + final_genres = [str(self.config.MyAnimeList.genres[g]) for g in genre_list if g in self.config.MyAnimeList.genres] final_attributes["genres"] = ",".join(final_genres) final_text += f"\nGenre: {' or '.join([self.config.MyAnimeList.genres[g] for g in final_genres])}" if "genre.not" in dict_methods: genre_list = util.parse(self.Type, "genre.not", dict_data, datatype="commalist", methods=dict_methods, parent=method_name) - final_genres = [self.config.MyAnimeList.genres[g] for g in genre_list if g in self.config.MyAnimeList.genres] + final_genres = [str(self.config.MyAnimeList.genres[g]) for g in genre_list if g in self.config.MyAnimeList.genres] final_attributes["genres_exclude"] = ",".join(final_genres) final_text += f"\nNot Genre: {' or '.join([self.config.MyAnimeList.genres[g] for g in final_genres])}" if "studio" in dict_methods: studio_list = util.parse(self.Type, "studio", dict_data, datatype="commalist", methods=dict_methods, parent=method_name) - final_studios = [self.config.MyAnimeList.studios[s] for s in studio_list if s in self.config.MyAnimeList.studios] + final_studios = [str(self.config.MyAnimeList.studios[s]) for s in studio_list if s in self.config.MyAnimeList.studios] final_attributes["producers"] = ",".join(final_studios) final_text += f"\nStudio: {' or '.join([self.config.MyAnimeList.studios[s] for s in final_studios])}" if "content_rating" in dict_methods: diff --git a/modules/mal.py b/modules/mal.py index 43d38e2f..8b5e272d 100644 --- a/modules/mal.py +++ b/modules/mal.py @@ -71,7 +71,7 @@ class MyAnimeList: for data in self._jiken_request("genres/anime")["data"]: self._genres[data["name"]] = int(data["mal_id"]) self._genres[data["name"].lower()] = int(data["mal_id"]) - self._genres[data["mal_id"]] = int(data["mal_id"]) + self._genres[str(data["mal_id"])] = int(data["mal_id"]) self._genres[int(data["mal_id"])] = data["name"] return self._genres @@ -81,7 +81,7 @@ class MyAnimeList: for data in self._jiken_request("producers")["data"]: self._studios[data["name"]] = int(data["mal_id"]) self._studios[data["name"].lower()] = int(data["mal_id"]) - self._studios[data["mal_id"]] = int(data["mal_id"]) + self._studios[str(data["mal_id"])] = int(data["mal_id"]) self._studios[int(data["mal_id"])] = data["name"] return self._studios