Exemplo n.º 1
0
        public async Task <object> Post(CreatePlaylist request)
        {
            var result = await _playlistManager.CreatePlaylist(new PlaylistCreationRequest
            {
                Name       = request.Name,
                ItemIdList = SplitValue(request.Ids, ','),
                UserId     = request.UserId,
                MediaType  = request.MediaType
            }).ConfigureAwait(false);

            return(ToOptimizedResult(result));
        }
Exemplo n.º 2
0
        public async Task <object> Post(CreatePlaylist request)
        {
            var result = await _playlistManager.CreatePlaylist(new PlaylistCreationRequest
            {
                Name       = request.Name,
                ItemIdList = (request.Ids ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(),
                UserId     = request.UserId,
                MediaType  = request.MediaType
            }).ConfigureAwait(false);

            return(ToOptimizedResult(result));
        }
Exemplo n.º 3
0
        public object Post(CreatePlaylist request)
        {
            var task = _playlistManager.CreatePlaylist(new PlaylistCreationOptions
            {
                Name       = request.Name,
                ItemIdList = (request.Ids ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(),
                UserId     = request.UserId
            });

            var item = task.Result;

            var dto = _dtoService.GetBaseItemDto(item, new List <ItemFields>());

            return(ToOptimizedResult(new PlaylistCreationResult
            {
                Id = dto.Id
            }));
        }