def get(self): """Search for a playlist.""" args = search_parser.parse_args() query = args["query"] search_args = { "query": query, "kind": SearchKind.playlists.name, "is_auto_complete": False, "current_user_id": None, "with_users": True, "limit": 10, "offset": 0 } response = search(search_args) playlists = list(map(extend_playlist, response["playlists"])) return success_response(playlists)
def get(self): args = search_parser.parse_args() query = args["query"] if not query: abort_bad_request_param("query", ns) search_args = { "query": query, "kind": SearchKind.users.name, "is_auto_complete": False, "current_user_id": None, "with_users": True, "limit": 10, "offset": 0, } response = search(search_args) return success_response(response)
def get(self): """Seach for a user.""" args = search_parser.parse_args() query = args["query"] search_args = { "query": query, "kind": SearchKind.users.name, "is_auto_complete": False, "current_user_id": None, "with_users": True, "limit": 10, "offset": 0, } response = search(search_args) users = response["users"] users = list(map(extend_user, users)) return success_response(users)
def get(self): """Search for a track.""" args = search_parser.parse_args() query = args["query"] if not query: abort_bad_request_param('query', ns) search_args = { "query": query, "kind": SearchKind.tracks.name, "is_auto_complete": False, "current_user_id": None, "with_users": True, "limit": 10, "offset": 0 } response = search(search_args) tracks = response["tracks"] tracks = list(map(extend_track, tracks)) return success_response(tracks)