Пример #1
0
        public async Task <object> Get(GetItemReport request)
        {
            var queryResult = await GetQueryResult(request).ConfigureAwait(false);

            var reportResult = GetReportResult(queryResult);

            return(ToOptimizedResult(reportResult));
        }
Пример #2
0
		/// <summary> Gets the given request. </summary>
		/// <param name="request"> The request. </param>
		/// <returns> A Task&lt;object&gt; </returns>
		public async Task<object> Get(GetItemReport request)
		{
			if (string.IsNullOrEmpty(request.IncludeItemTypes))
				return null;

			var reportResult = await GetReportResult(request);

			return ToOptimizedResult(reportResult);
		}
Пример #3
0
        /// <summary> Gets report result. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> The report result. </returns>
        private ReportResult GetReportResult(GetItemReport request, User user)
        {
            ReportBuilder          reportBuilder = new ReportBuilder(_libraryManager);
            QueryResult <BaseItem> queryResult   = GetQueryResult(request, user);
            ReportResult           reportResult  = reportBuilder.GetResult(queryResult.Items, request);

            reportResult.TotalRecordCount = queryResult.TotalRecordCount;

            return(reportResult);
        }
Пример #4
0
        /// <summary> Gets report result. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> The report result. </returns>
        private async Task <ReportResult> GetReportResult(GetItemReport request)
        {
            ReportBuilder          reportBuilder = new ReportBuilder(_libraryManager);
            QueryResult <BaseItem> queryResult   = await GetQueryResult(request).ConfigureAwait(false);

            ReportResult reportResult = reportBuilder.GetResult(queryResult.Items, request);

            reportResult.TotalRecordCount = queryResult.TotalRecordCount;

            return(reportResult);
        }
Пример #5
0
        /// <summary> Gets the given request. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> A Task&lt;object&gt; </returns>
        public async Task <object> Get(GetItemReport request)
        {
            if (string.IsNullOrEmpty(request.IncludeItemTypes))
            {
                return(null);
            }

            var reportResult = await GetReportResult(request);

            return(ToOptimizedResult(reportResult));
        }
Пример #6
0
        /// <summary> Gets the given request. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> A Task&lt;object&gt; </returns>
        public object Get(GetItemReport request)
        {
            if (string.IsNullOrEmpty(request.IncludeItemTypes))
            {
                return(null);
            }

            request.DisplayType = "Screen";
            var user         = !string.IsNullOrWhiteSpace(request.UserId) ? _userManager.GetUserById(request.UserId) : null;
            var reportResult = GetReportResult(request, user);

            return(reportResult);
        }
Пример #7
0
        /// <summary> Gets report result. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> The report result. </returns>
        private async Task<ReportResult> GetReportResult(GetItemReport request)
        {
            ReportBuilder reportBuilder = new ReportBuilder(_libraryManager);
            QueryResult<BaseItem> queryResult = await GetQueryResult(request).ConfigureAwait(false);
            ReportResult reportResult = reportBuilder.GetResult(queryResult.Items, request);
            reportResult.TotalRecordCount = queryResult.TotalRecordCount;

            return reportResult;
        }
Пример #8
0
        /// <summary> Gets the given request. </summary>
        /// <param name="request"> The request. </param>
        /// <returns> A Task&lt;object&gt; </returns>
        public async Task<object> Get(GetItemReport 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 GetReportResult(request, user);

            return ToOptimizedResult(reportResult);
        }
Пример #9
0
        public ActionResult <ReportResult> GetItemReport(
            [FromQuery] string maxOfficialRating,
            [FromQuery] bool?hasThemeSong,
            [FromQuery] bool?hasThemeVideo,
            [FromQuery] bool?hasSubtitles,
            [FromQuery] bool?hasSpecialFeature,
            [FromQuery] bool?hasTrailer,
            [FromQuery] string?adjacentTo,
            [FromQuery] int?minIndexNumber,
            [FromQuery] int?parentIndexNumber,
            [FromQuery] bool?hasParentalRating,
            [FromQuery] bool?isHd,
            [FromQuery] string?locationTypes,
            [FromQuery] string?excludeLocationTypes,
            [FromQuery] bool?isMissing,
            [FromQuery] bool?isUnaried,
            [FromQuery] double?minCommunityRating,
            [FromQuery] double?minCriticRating,
            [FromQuery] int?airedDuringSeason,
            [FromQuery] string?minPremiereDate,
            [FromQuery] string?minDateLastSaved,
            [FromQuery] string?minDateLastSavedForUser,
            [FromQuery] string?maxPremiereDate,
            [FromQuery] bool?hasOverview,
            [FromQuery] bool?hasImdbId,
            [FromQuery] bool?hasTmdbId,
            [FromQuery] bool?hasTvdbId,
            [FromQuery] bool?isInBoxSet,
            [FromQuery] string?excludeItemIds,
            [FromQuery] bool?enableTotalRecordCount,
            [FromQuery] int?startIndex,
            [FromQuery] int?limit,
            [FromQuery] bool?recursive,
            [FromQuery] string?sortOrder,
            [FromQuery] string?parentId,
            [FromQuery] string?fields,
            [FromQuery] string?excludeItemTypes,
            [FromQuery] string?includeItemTypes,
            [FromQuery] string?filters,
            [FromQuery] bool?isFavorite,
            [FromQuery] bool?isNotFavorite,
            [FromQuery] string?mediaTypes,
            [FromQuery] string?imageTypes,
            [FromQuery] string?sortBy,
            [FromQuery] bool?isPlayed,
            [FromQuery] string?genres,
            [FromQuery] string?genreIds,
            [FromQuery] string?officialRatings,
            [FromQuery] string?tags,
            [FromQuery] string?years,
            [FromQuery] bool?enableUserData,
            [FromQuery] int?imageTypeLimit,
            [FromQuery] string?enableImageTypes,
            [FromQuery] string?person,
            [FromQuery] string?personIds,
            [FromQuery] string?personTypes,
            [FromQuery] string?studios,
            [FromQuery] string?studioIds,
            [FromQuery] string?artists,
            [FromQuery] string?excludeArtistIds,
            [FromQuery] string?artistIds,
            [FromQuery] string?albums,
            [FromQuery] string?albumIds,
            [FromQuery] string?ids,
            [FromQuery] string?videoTypes,
            [FromQuery] string?userId,
            [FromQuery] string?minOfficialRating,
            [FromQuery] bool?isLocked,
            [FromQuery] bool?isPlaceHolder,
            [FromQuery] bool?hasOfficialRating,
            [FromQuery] bool?collapseBoxSetItems,
            [FromQuery] bool?is3D,
            [FromQuery] string?seriesStatus,
            [FromQuery] string?nameStartsWithOrGreater,
            [FromQuery] string?nameStartsWith,
            [FromQuery] string?nameLessThan,
            [FromQuery] string?reportView,
            [FromQuery] string?displayType,
            [FromQuery] bool?hasQueryLimit,
            [FromQuery] string?groupBy,
            [FromQuery] string?reportColumns,
            [FromQuery] bool enableImages = true)
        {
            var request = new GetItemReport
            {
                Albums              = albums,
                AdjacentTo          = adjacentTo,
                AiredDuringSeason   = airedDuringSeason,
                AlbumIds            = albumIds,
                ArtistIds           = artistIds,
                Artists             = artists,
                CollapseBoxSetItems = collapseBoxSetItems,
                DisplayType         = displayType,
                EnableImages        = enableImages,
                EnableImageTypes    = enableImageTypes,
                Fields              = fields,
                Filters             = filters,
                Genres              = genres,
                Ids                     = ids,
                Limit                   = limit,
                Person                  = person,
                Recursive               = recursive ?? true,
                Studios                 = studios,
                Tags                    = tags,
                Years                   = years,
                GenreIds                = genreIds,
                GroupBy                 = groupBy,
                HasOverview             = hasOverview,
                HasSubtitles            = hasSubtitles,
                HasTrailer              = hasTrailer,
                ImageTypes              = imageTypes,
                Is3D                    = is3D,
                IsFavorite              = isFavorite ?? false,
                IsLocked                = isLocked,
                IsMissing               = isMissing,
                IsPlayed                = isPlayed,
                IsUnaired               = isUnaried,
                LocationTypes           = locationTypes,
                MediaTypes              = mediaTypes,
                OfficialRatings         = officialRatings,
                ParentId                = parentId,
                PersonIds               = personIds,
                PersonTypes             = personTypes,
                ReportColumns           = reportColumns,
                ReportView              = reportView,
                SeriesStatus            = seriesStatus,
                SortBy                  = sortBy,
                SortOrder               = sortOrder,
                StartIndex              = startIndex,
                StudioIds               = studioIds,
                UserId                  = userId,
                VideoTypes              = videoTypes,
                EnableUserData          = enableUserData,
                ExcludeArtistIds        = excludeArtistIds,
                ExcludeItemIds          = excludeItemIds,
                ExcludeItemTypes        = excludeItemTypes,
                ExcludeLocationTypes    = excludeLocationTypes,
                HasImdbId               = hasImdbId,
                HasOfficialRating       = hasOfficialRating,
                HasParentalRating       = hasParentalRating,
                HasQueryLimit           = hasQueryLimit ?? false,
                HasSpecialFeature       = hasSpecialFeature,
                HasThemeSong            = hasThemeSong,
                HasThemeVideo           = hasThemeVideo,
                HasTmdbId               = hasTmdbId,
                HasTvdbId               = hasTvdbId,
                ImageTypeLimit          = imageTypeLimit,
                IncludeItemTypes        = includeItemTypes,
                IsHD                    = isHd,
                IsNotFavorite           = isNotFavorite ?? false,
                IsPlaceHolder           = isPlaceHolder,
                MaxOfficialRating       = maxOfficialRating,
                MaxPremiereDate         = maxPremiereDate,
                MinCommunityRating      = minCommunityRating,
                MinCriticRating         = minCriticRating,
                MinIndexNumber          = minIndexNumber,
                MinOfficialRating       = minOfficialRating,
                MinPremiereDate         = minPremiereDate,
                NameLessThan            = nameLessThan,
                NameStartsWith          = nameStartsWith,
                ParentIndexNumber       = parentIndexNumber,
                EnableTotalRecordCount  = enableTotalRecordCount ?? true,
                IsInBoxSet              = isInBoxSet,
                MinDateLastSaved        = minDateLastSaved,
                NameStartsWithOrGreater = nameStartsWithOrGreater,
                MinDateLastSavedForUser = minDateLastSavedForUser
            };

            return(Ok(_reportsService.Get(request)));
        }