/// <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(ToOptimizedSerializedResultUsingCache(result)); }
/// <summary> /// Gets the specified request. /// </summary> /// <param name="request">The request.</param> /// <returns>System.Object.</returns> public object Get(GetSimilarAlbums request) { var dtoOptions = GetDtoOptions(request); var result = SimilarItemsHelper.GetSimilarItemsResult(dtoOptions, _userManager, _itemRepo, _libraryManager, _userDataRepository, _dtoService, Logger, request, new[] { typeof(MusicAlbum) }, GetAlbumSimilarityScore); return(ToOptimizedSerializedResultUsingCache(result)); }
public object Get(GetSimilarArtists request) { var dtoOptions = GetDtoOptions(_authContext, request); var result = SimilarItemsHelper.GetSimilarItemsResult(dtoOptions, _userManager, _itemRepo, _libraryManager, _userDataRepository, _dtoService, Logger, request, new[] { typeof(MusicArtist) }, SimilarItemsHelper.GetSimiliarityScore); return(ToOptimizedResult(result)); }
/// <summary> /// Gets the specified request. /// </summary> /// <param name="request">The request.</param> /// <returns>System.Object.</returns> public async Task <object> Get(GetSimilarAlbums request) { var dtoOptions = GetDtoOptions(_authContext, request); var result = await SimilarItemsHelper.GetSimilarItemsResult(dtoOptions, _userManager, _itemRepo, _libraryManager, _userDataRepository, _dtoService, Logger, request, new[] { typeof(MusicAlbum) }, GetAlbumSimilarityScore).ConfigureAwait(false); return(ToOptimizedSerializedResultUsingCache(result)); }
/// <summary> /// Gets the specified request. /// </summary> /// <param name="request">The request.</param> /// <returns>System.Object.</returns> public object Get(GetSimilarTrailers request) { var result = SimilarItemsHelper.GetSimilarItemsResult(_userManager, _itemRepo, _libraryManager, _userDataRepository, _dtoService, Logger, // Strip out secondary versions request, item => (item is Movie || item is Trailer) && !((Video)item).PrimaryVersionId.HasValue, SimilarItemsHelper.GetSimiliarityScore); return(ToOptimizedSerializedResultUsingCache(result)); }
public ActionResult <QueryResult <BaseItemDto> > GetSimilarArtists( [FromRoute] string artistId, [FromQuery] Guid?userId, [FromQuery] string?excludeArtistIds, [FromQuery] int?limit) { var dtoOptions = new DtoOptions().AddClientFields(Request); return(SimilarItemsHelper.GetSimilarItemsResult( dtoOptions, _userManager, _libraryManager, _dtoService, userId, artistId, excludeArtistIds, limit, new[] { typeof(MusicArtist) }, SimilarItemsHelper.GetSimiliarityScore)); }