diff --git a/src/palace/manager/core/classifier/simplified.py b/src/palace/manager/core/classifier/simplified.py index 0c208a8f2..a8246c7ab 100644 --- a/src/palace/manager/core/classifier/simplified.py +++ b/src/palace/manager/core/classifier/simplified.py @@ -1,13 +1,7 @@ from urllib.parse import unquote -from palace.manager.core.classifier import ( - NO_VALUE, - Classifier, - Lowercased, - fiction_genres, - genres, - nonfiction_genres, -) +from palace.manager.core import classifier +from palace.manager.core.classifier import NO_VALUE, Classifier, Lowercased class SimplifiedGenreClassifier(Classifier): @@ -27,27 +21,27 @@ def scrub_identifier(cls, identifier): @classmethod def genre(cls, identifier, name, fiction=None, audience=None): if fiction == True: - all_genres = fiction_genres + all_genres = classifier.fiction_genres elif fiction == False: - all_genres = nonfiction_genres + all_genres = classifier.nonfiction_genres else: - all_genres = fiction_genres + nonfiction_genres + all_genres = classifier.fiction_genres + classifier.nonfiction_genres return cls._genre_by_name(identifier.original, all_genres) @classmethod def is_fiction(cls, identifier, name): - if not genres.get(identifier.original): + if not classifier.genres.get(identifier.original): return None - return genres[identifier.original].is_fiction + return classifier.genres[identifier.original].is_fiction @classmethod def _genre_by_name(cls, name, genres): for genre in genres: if genre == name: - return genres[name] + return classifier.genres[name] elif isinstance(genre, dict): if name == genre["name"] or name in genre.get("subgenres", []): - return genres[name] + return classifier.genres[name] return None