diff --git a/mopidy/models.py b/mopidy/models.py index 3dd2c67c..4b268474 100644 --- a/mopidy/models.py +++ b/mopidy/models.py @@ -313,13 +313,11 @@ def model_json_decoder(dct): """ if '__model__' in dct: + # TODO: move models to a global constant once we split this module models = {c.__name__: c for c in ImmutableObject.__subclasses__()} model_name = dct.pop('__model__') if model_name in models: - kwargs = {} - for key, value in dct.items(): - kwargs[key] = value - return models[model_name](**kwargs) + return models[model_name](**dct) return dct