Пример #1
0
        /// <summary>
        /// Gets the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>System.Object.</returns>
        public object Get(GetSimilarMovies request)
        {
            var result = SimilarItemsHelper.GetSimilarItemsResult(_userManager,
                                                                  _itemRepo,
                                                                  _libraryManager,
                                                                  _userDataRepository,
                                                                  Logger,
                                                                  request, item => item is Movie || (item is Trailer && request.IncludeTrailers),
                                                                  SimilarItemsHelper.GetSimiliarityScore);

            return(ToOptimizedResult(result));
        }
Пример #2
0
        /// <summary>
        /// Gets the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>System.Object.</returns>
        public object Get(GetSimilarGames request)
        {
            var result = SimilarItemsHelper.GetSimilarItemsResult(_userManager,
                                                                  _itemRepo,
                                                                  _libraryManager,
                                                                  _userDataRepository,
                                                                  Logger,
                                                                  request, item => item is Game,
                                                                  SimilarItemsHelper.GetSimiliarityScore);

            return(ToOptimizedResult(result));
        }
Пример #3
0
        /// <summary>
        /// Gets the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>System.Object.</returns>
        public object Get(GetSimilarShows request)
        {
            var result = SimilarItemsHelper.GetSimilarItemsResult(_userManager,
                                                                  _itemRepo,
                                                                  _libraryManager,
                                                                  _userDataManager,
                                                                  _dtoService,
                                                                  Logger,
                                                                  request, item => item is Series,
                                                                  SimilarItemsHelper.GetSimiliarityScore);

            return(ToOptimizedSerializedResultUsingCache(result));
        }
Пример #4
0
        /// <summary>
        /// Gets the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>System.Object.</returns>
        public object Get(GetSimilarAlbums request)
        {
            var result = SimilarItemsHelper.GetSimilarItemsResult(_userManager,
                                                                  _itemRepo,
                                                                  _libraryManager,
                                                                  _userDataRepository,
                                                                  _dtoService,
                                                                  Logger,
                                                                  request, item => item is MusicAlbum,
                                                                  GetAlbumSimilarityScore);

            return(ToOptimizedResult(result));
        }
Пример #5
0
        /// <summary>
        /// Gets the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>System.Object.</returns>
        public object Get(GetSimilarGames request)
        {
            var dtoOptions = GetDtoOptions(request);

            var result = SimilarItemsHelper.GetSimilarItemsResult(dtoOptions, _userManager,
                                                                  _itemRepo,
                                                                  _libraryManager,
                                                                  _userDataRepository,
                                                                  _dtoService,
                                                                  Logger,
                                                                  request, new[] { typeof(Game) },
                                                                  SimilarItemsHelper.GetSimiliarityScore);

            return(ToOptimizedSerializedResultUsingCache(result));
        }