コード例 #1
0
        private async Task <IEnumerable <RecordingInfo> > GetRecordingsAsync(GetRecordings request)
        {
            var services = _liveTvManager.Services;

            var tasks = services.Select(i => i.GetRecordingsAsync(CancellationToken.None));

            var recordings = await Task.WhenAll(tasks).ConfigureAwait(false);

            return(recordings.SelectMany(i => i));
        }
コード例 #2
0
ファイル: LiveTvService.cs プロジェクト: ilovejs/MediaBrowser
        public object Get(GetRecordings request)
        {
            var result = _liveTvManager.GetRecordings(new RecordingQuery
            {
                ChannelId     = request.ChannelId,
                UserId        = request.UserId,
                GroupId       = request.GroupId,
                StartIndex    = request.StartIndex,
                Limit         = request.Limit,
                Status        = request.Status,
                SeriesTimerId = request.SeriesTimerId,
                IsInProgress  = request.IsInProgress
            }, CancellationToken.None).Result;

            return(ToOptimizedSerializedResultUsingCache(result));
        }
コード例 #3
0
ファイル: LiveTvService.cs プロジェクト: webcris77/Emby
        public async Task <object> Get(GetRecordings request)
        {
            var options = GetDtoOptions(request);

            options.DeviceId = AuthorizationContext.GetAuthorizationInfo(Request).DeviceId;

            var result = await _liveTvManager.GetRecordings(new RecordingQuery
            {
                ChannelId     = request.ChannelId,
                UserId        = request.UserId,
                GroupId       = request.GroupId,
                StartIndex    = request.StartIndex,
                Limit         = request.Limit,
                Status        = request.Status,
                SeriesTimerId = request.SeriesTimerId,
                IsInProgress  = request.IsInProgress
            }, options, CancellationToken.None).ConfigureAwait(false);

            return(ToOptimizedResult(result));
        }
コード例 #4
0
        public object Get(GetRecordings request)
        {
            var result = GetRecordingsAsync(request).Result;

            return(ToOptimizedResult(result));
        }