Esempio n. 1
0
def get_reposters_for_playlist_route(repost_playlist_id):
    try:
        current_user_id = get_current_user_id(required=False)
        (limit, offset) = get_pagination_vars()
        args = {
            'repost_playlist_id': repost_playlist_id,
            'current_user_id': current_user_id,
            'limit': limit,
            'offset': offset
        }
        user_results = get_reposters_for_playlist(args)
        return api_helpers.success_response(user_results)
    except exceptions.NotFoundError as e:
        return api_helpers.error_response(str(e), 404)
 def get(self, playlist_id):
     args = playlist_reposts_route_parser.parse_args()
     decoded_id = decode_with_abort(playlist_id, full_ns)
     limit = get_default_max(args.get('limit'), 10, 100)
     offset = get_default_max(args.get('offset'), 0)
     current_user_id = get_current_user_id(args)
     args = {
         'repost_playlist_id': decoded_id,
         'current_user_id': current_user_id,
         'limit': limit,
         'offset': offset
     }
     users = get_reposters_for_playlist(args)
     users = list(map(extend_user, users))
     return success_response(users)
Esempio n. 3
0
def get_reposters_for_playlist_route(repost_playlist_id):
    try:
        user_results = get_reposters_for_playlist(repost_playlist_id)
        return api_helpers.success_response(user_results)
    except exceptions.NotFoundError as e:
        return api_helpers.error_response(str(e), 404)