コード例 #1
0
ファイル: ReportsService.cs プロジェクト: paul-777/Emby
        /// <summary> Gets the given request. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> A Task&lt;object&gt; </returns>
        public async Task<object> Get(GetReportStatistics request)
        {
            if (string.IsNullOrEmpty(request.IncludeItemTypes))
                return null;
            request.DisplayType = "Screen";
            var reportResult = await GetReportStatistic(request);

            return ToOptimizedResult(reportResult);
        }
コード例 #2
0
ファイル: ReportsService.cs プロジェクト: paul-777/Emby
        /// <summary> Gets report statistic. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> The report statistic. </returns>
        private async Task<ReportStatResult> GetReportStatistic(GetReportStatistics request)
        {
            ReportIncludeItemTypes reportRowType = ReportHelper.GetRowType(request.IncludeItemTypes);
            QueryResult<BaseItem> queryResult = await GetQueryResult(request).ConfigureAwait(false);

            ReportStatBuilder reportBuilder = new ReportStatBuilder(_libraryManager);
            ReportStatResult reportResult = reportBuilder.GetResult(queryResult.Items, ReportHelper.GetRowType(request.IncludeItemTypes), request.TopItems ?? 5);
            reportResult.TotalRecordCount = reportResult.Groups.Count();
            return reportResult;
        }
コード例 #3
0
ファイル: ReportsService.cs プロジェクト: softworkz/Emby
        /// <summary> Gets the given request. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> A Task&lt;object&gt; </returns>
        public async Task<object> Get(GetReportStatistics request)
        {
            if (string.IsNullOrEmpty(request.IncludeItemTypes))
                return null;
            request.DisplayType = "Screen";
            var user = !string.IsNullOrWhiteSpace(request.UserId) ? _userManager.GetUserById(request.UserId) : null;
            var reportResult = await GetReportStatistic(request, user);

            return ToOptimizedResult(reportResult);
        }