even more generic
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-11-26 23:46:34 +01:00
parent d6780481d3
commit ecaec93819
2 changed files with 10 additions and 9 deletions

View File

@@ -25,18 +25,18 @@ class ItemApi(APIInteractionResource):
current_app.logger.info(e)
abort(401, "unauthorized")
try:
item_type = flaskred.get(itemid).decode('UTF-8')
itemtype = flaskred.get(itemid).decode('UTF-8')
except Exception as e:
current_app.logger.warning(e)
abort(404, "unknown item")
if item_type == 'release':
if itemtype == 'release':
return self.getreleaseinfo(itemid), 200
elif item_type == 'artist':
elif itemtype == 'artist':
return self.getartistinfo(itemid), 200
elif item_type == 'work':
elif itemtype == 'work':
return self.getworkinfo(itemid), 200
elif item_type == 'recording':
elif itemtype == 'recording':
return self.getrecordinginfo(itemid), 200
else:
abort(417, "wrong type of item")