public async Task <object> Get(GetLiveMediaInfo request) { var item = _libraryManager.GetItemById(request.Id); IEnumerable <MediaSourceInfo> mediaSources; var channelItem = item as IChannelMediaItem; var user = _userManager.GetUserById(request.UserId); if (channelItem != null) { mediaSources = await _channelManager.GetChannelItemMediaSources(request.Id, true, CancellationToken.None) .ConfigureAwait(false); } else { var hasMediaSources = (IHasMediaSources)item; if (user == null) { mediaSources = hasMediaSources.GetMediaSources(true); } else { mediaSources = hasMediaSources.GetMediaSources(true, user); } } return(ToOptimizedResult(new LiveMediaInfoResult { MediaSources = mediaSources.ToList() })); }
public Task <object> Get(GetLiveMediaInfo request) { return(GetPlaybackInfo(request.Id, request.UserId)); }
public async Task <object> Get(GetLiveMediaInfo request) { var result = await GetPlaybackInfo(request.Id, request.UserId, new[] { MediaType.Audio, MediaType.Video }).ConfigureAwait(false); return(ToOptimizedResult(result)); }