updated mbt api
This commit is contained in:
parent
3b63b7fa61
commit
1ae58d90ea
|
@ -62,6 +62,12 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
|
||||
[ApiMember(Name = "RomanceGenre", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
|
||||
public string RomanceGenre { get; set; }
|
||||
|
||||
[ApiMember(Name = "LatestMoviesLimit", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
||||
public int LatestMoviesLimit { get; set; }
|
||||
|
||||
[ApiMember(Name = "LatestTrailersLimit", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
|
||||
public int LatestTrailersLimit { get; set; }
|
||||
}
|
||||
|
||||
[Route("/MBT/DefaultTheme/Favorites", "GET")]
|
||||
|
@ -481,6 +487,9 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
var movies = items.OfType<Movie>()
|
||||
.ToList();
|
||||
|
||||
var trailers = items.OfType<Trailer>()
|
||||
.ToList();
|
||||
|
||||
var hdMovies = movies.Where(i => i.IsHD).ToList();
|
||||
|
||||
var familyGenres = request.FamilyGenre.Split(',').ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
|
||||
|
@ -515,8 +524,7 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Take(1)
|
||||
.ToList();
|
||||
|
||||
view.TrailerItems = items
|
||||
.OfType<Trailer>()
|
||||
view.TrailerItems = trailers
|
||||
.Where(i => !string.IsNullOrEmpty(i.PrimaryImagePath))
|
||||
.OrderBy(i => Guid.NewGuid())
|
||||
.Select(i => GetItemStub(i, ImageType.Primary))
|
||||
|
@ -623,6 +631,20 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.LatestMovies = movies
|
||||
.OrderByDescending(i => i.DateCreated)
|
||||
.Where(i => !_userDataManager.GetUserData(user.Id, i.GetUserDataKey()).Played)
|
||||
.Take(request.LatestMoviesLimit)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
view.LatestTrailers = trailers
|
||||
.OrderByDescending(i => i.DateCreated)
|
||||
.Where(i => !_userDataManager.GetUserData(user.Id, i.GetUserDataKey()).Played)
|
||||
.Take(request.LatestTrailersLimit)
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToList();
|
||||
|
||||
return ToOptimizedResult(view);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,9 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
public double FamilyMoviePercentage { get; set; }
|
||||
|
||||
public double HDMoviePercentage { get; set; }
|
||||
|
||||
public List<BaseItemDto> LatestTrailers { get; set; }
|
||||
public List<BaseItemDto> LatestMovies { get; set; }
|
||||
}
|
||||
|
||||
public class TvView : BaseView
|
||||
|
|
|
@ -80,7 +80,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
{
|
||||
get
|
||||
{
|
||||
return ItemUpdateType.ImageUpdate | ItemUpdateType.MetadataDownload;
|
||||
return ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user