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