fix for #223 arr tags must be lowercase

pull/240/head
meisnate12 4 years ago
parent 2ff46b3b06
commit 8add37d156

@ -52,9 +52,9 @@ class RadarrAPI:
def add_tags(self, tags): def add_tags(self, tags):
added = False added = False
for label in tags: for label in tags:
if label not in self.tags: if str(label).lower() not in self.tags:
added = True added = True
self.send_post("tag", {"label": str(label)}) self.send_post("tag", {"label": str(label).lower()})
if added: if added:
self.tags = self.get_tags() self.tags = self.get_tags()
@ -78,7 +78,7 @@ class RadarrAPI:
search = options["search"] if "search" in options else self.search search = options["search"] if "search" in options else self.search
if tags: if tags:
self.add_tags(tags) self.add_tags(tags)
tag_nums = [self.tags[label] for label in tags if label in self.tags] tag_nums = [self.tags[label.lower()] for label in tags if label.lower() in self.tags]
for tmdb_id in tmdb_ids: for tmdb_id in tmdb_ids:
try: try:
movie_info = self.lookup(tmdb_id) movie_info = self.lookup(tmdb_id)

@ -72,9 +72,9 @@ class SonarrAPI:
def add_tags(self, tags): def add_tags(self, tags):
added = False added = False
for label in tags: for label in tags:
if label not in self.tags: if str(label).lower() not in self.tags:
added = True added = True
self.send_post("tag", {"label": str(label)}) self.send_post("tag", {"label": str(label).lower()})
if added: if added:
self.tags = self.get_tags() self.tags = self.get_tags()
@ -101,7 +101,7 @@ class SonarrAPI:
cutoff_search = options["cutoff_search"] if "cutoff_search" in options else self.cutoff_search cutoff_search = options["cutoff_search"] if "cutoff_search" in options else self.cutoff_search
if tags: if tags:
self.add_tags(tags) self.add_tags(tags)
tag_nums = [self.tags[label] for label in tags if label in self.tags] tag_nums = [self.tags[label.lower()] for label in tags if label.lower() in self.tags]
for tvdb_id in tvdb_ids: for tvdb_id in tvdb_ids:
try: try:
show_info = self.lookup(tvdb_id) show_info = self.lookup(tvdb_id)

Loading…
Cancel
Save