fix anilist_search

This commit is contained in:
meisnate12 2021-08-16 08:54:28 -04:00
parent f727068317
commit 1ad1068c8d
2 changed files with 2 additions and 2 deletions

View file

@ -14,7 +14,7 @@ mod_searches = [
"episodes.gt", "episodes.gte", "episodes.lt", "episodes.lte", "duration.gt", "duration.gte", "duration.lt", "duration.lte",
"score.gt", "score.gte", "score.lt", "score.lte", "popularity.gt", "popularity.gte", "popularity.lt", "popularity.lte"
]
no_mod_searches = ["search", "season", "year", "adult", "min_tag_percent"]
no_mod_searches = ["search", "season", "year", "adult", "min_tag_percent", "limit", "sort_by"]
searches = mod_searches + no_mod_searches
search_types = {
"search": "String", "season": "MediaSeason", "seasonYear": "Int", "isAdult": "Boolean", "minimumTagRank": "Int",

View file

@ -763,7 +763,7 @@ class CollectionBuilder:
new_dictionary = {}
for search_method, search_data in dict_data.items():
search_attr, modifier, search_final = self._split(search_method)
if search_data is None:
if search_attr not in ["season", "year"] and search_data is None:
raise Failed(f"Collection Error: {method_name} {search_final} attribute is blank")
elif search_final not in anilist.searches:
raise Failed(f"Collection Error: {method_name} {search_final} attribute not supported")