def create_from_item_id(id_: int, paint_id: int, api: RLGarageAPI): if id_ == 0: return LoadoutItem("None", "", 0, 0) try: item = api.get_item(id_, paint_id) except Exception as e: logger.debug("Error with loadout: %s", str(e)) return LoadoutItem("Unknown", "", 0, 0) return LoadoutItem(item['name'], item['image'], paint_id, item['rarity'])
def api_get_item(query_params=None): api = RLGarageAPI() return better_jsonify(api.get_item(query_params['id']))