[29] fix tmdb region error

pull/811/head
meisnate12 3 years ago
parent 0b99b1994d
commit 3b3343fe07

@ -1 +1 @@
1.16.2-develop28
1.16.2-develop29

@ -788,7 +788,7 @@ class CollectionBuilder:
else:
logger.error(f"{self.Type} Error: Theme Path Does Not Exist: {os.path.abspath(method_data)}")
elif method_name == "tmdb_region":
self.tmdb_region = util.parse(self.Type, method_name, str(method_data).upper(), options=self.config.TMDb.iso_3166_1)
self.tmdb_region = util.parse(self.Type, method_name, method_data, options=self.config.TMDb.iso_3166_1)
elif method_name == "collection_mode":
self.details[method_name] = util.check_collection_mode(method_data)
elif method_name == "minimum_items":

@ -381,7 +381,8 @@ class ConfigFile:
"language": check_for_attribute(self.data, "language", parent="tmdb", default="en"),
"expiration": check_for_attribute(self.data, "cache_expiration", parent="tmdb", var_type="int", default=60)
})
self.TMDb.region = check_for_attribute(self.data, "region", parent="tmdb", test_list=self.TMDb.iso_3166_1, default_is_none=True)
region = check_for_attribute(self.data, "region", parent="tmdb", test_list=self.TMDb.iso_3166_1, default_is_none=True)
self.TMDb.region = str(region).upper() if region else region
logger.info(f"TMDb Connection {'Failed' if self.TMDb is None else 'Successful'}")
else:
raise Failed("Config Error: tmdb attribute not found")

@ -158,7 +158,7 @@ class TMDb:
self.TMDb = TMDbAPIs(self.apikey, language=self.language, session=self.config.session)
except TMDbException as e:
raise Failed(f"TMDb Error: {e}")
self.iso_3166_1 = [i.upper() for i in self.TMDb._iso_3166_1]
self.iso_3166_1 = {iso: i.name for iso, i in self.TMDb._iso_3166_1.items()}
def convert_from(self, tmdb_id, convert_to, is_movie):
item = self.get_movie(tmdb_id) if is_movie else self.get_show(tmdb_id)

Loading…
Cancel
Save