add landing screen settings

This commit is contained in:
Luke Pulverenti
2017-04-18 16:11:42 -04:00
parent 310f0e2811
commit 7147bec7d8
3 changed files with 17 additions and 56 deletions

View File

@@ -31,17 +31,6 @@ namespace MediaBrowser.Api.UserLibrary
public string PresetViews { get; set; }
}
[Route("/Users/{UserId}/SpecialViewOptions", "GET")]
public class GetSpecialViewOptions : IReturn<List<SpecialViewOption>>
{
/// <summary>
/// Gets or sets the user id.
/// </summary>
/// <value>The user id.</value>
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public string UserId { get; set; }
}
[Route("/Users/{UserId}/GroupingOptions", "GET")]
public class GetGroupingOptions : IReturn<List<SpecialViewOption>>
{
@@ -114,29 +103,6 @@ namespace MediaBrowser.Api.UserLibrary
return ToOptimizedResult(result);
}
public async Task<object> Get(GetSpecialViewOptions request)
{
var user = _userManager.GetUserById(request.UserId);
var views = user.RootFolder
.GetChildren(user, true)
.OfType<ICollectionFolder>()
.Where(IsEligibleForSpecialView)
.ToList();
var list = views
.Select(i => new SpecialViewOption
{
Name = i.Name,
Id = i.Id.ToString("N")
})
.OrderBy(i => i.Name)
.ToList();
return ToOptimizedResult(list);
}
public async Task<object> Get(GetGroupingOptions request)
{
var user = _userManager.GetUserById(request.UserId);
@@ -159,11 +125,6 @@ namespace MediaBrowser.Api.UserLibrary
return ToOptimizedResult(list);
}
private bool IsEligibleForSpecialView(ICollectionFolder view)
{
return UserView.IsEligibleForEnhancedView(view.CollectionType);
}
}
class SpecialViewOption