Added IncludeTrailers param for similar movies

pull/702/head
Luke Pulverenti 12 years ago
parent fa3a5174fe
commit 91b91e61b5

@ -13,6 +13,13 @@ namespace MediaBrowser.Api
[Api(Description = "Finds movies and trailers similar to a given movie.")] [Api(Description = "Finds movies and trailers similar to a given movie.")]
public class GetSimilarMovies : BaseGetSimilarItems public class GetSimilarMovies : BaseGetSimilarItems
{ {
[ApiMember(Name = "IncludeTrailers", Description = "Whether or not to include trailers within the results. Defaults to true.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
public bool IncludeTrailers { get; set; }
public GetSimilarMovies()
{
IncludeTrailers = true;
}
} }
/// <summary> /// <summary>
@ -58,7 +65,7 @@ namespace MediaBrowser.Api
_libraryManager, _libraryManager,
_userDataRepository, _userDataRepository,
Logger, Logger,
request, item => item is Movie || item is Trailer, request, item => item is Movie || (item is Trailer && request.IncludeTrailers),
SimilarItemsHelper.GetSimiliarityScore); SimilarItemsHelper.GetSimiliarityScore);
return ToOptimizedResult(result); return ToOptimizedResult(result);

Loading…
Cancel
Save