Ejemplo n.º 1
0
        public async Task <ActionResult <IEnumerable <PlaylistDownloadModel> > > GetUserPlaylistsAsync(int page, int pageSize)
        {
            try
            {
                var playlists = await PlaylistModel.GetUserPlaylistsAsync(
                    _spotifyAPICredentials,
                    ExtractUserIdFromToken(),
                    page,
                    pageSize,
                    RepositoryManager).ConfigureAwait(false);

                return(Ok(MapEntitiesToDownloadModels <SimplePlaylist, PlaylistDownloadModel>(playlists)));
            }
            catch (Exception err)
            {
                LogException(err);

                return(Problem("There was an error fetching a random album from Spotify", statusCode: 500, type: err.GetType().ToString()));
            }
        }