def get(self): request_args = under_the_radar_parser.parse_args() args = { "tracks_only": request_args.get("tracks_only"), "with_users": request_args.get("with_users"), "limit": format_limit(request_args, 100, 25), "offset": format_offset(request_args), "user_id": get_current_user_id(request_args), "filter": request_args.get("filter"), } feed_results = get_feed(args) feed_results = list(map(extend_track, feed_results)) return success_response(feed_results)
def get_feed_route(): args = to_dict(request.args) # filter should be one of ["all", "reposts", "original"] # empty filter value results in "all" if "filter" in request.args and request.args.get("filter") in ["all", "repost", "original"]: args["filter"] = args.get("filter") else: args["filter"] = "all" if "tracks_only" in request.args: args["tracks_only"] = parse_bool_param(request.args.get("tracks_only")) if "with_users" in request.args: args["with_users"] = parse_bool_param(request.args.get("with_users")) feed_results = get_feed(args) return api_helpers.success_response(feed_results)