Side Nav Redesign (#2310)
This commit is contained in:
parent
5c2ebb87cc
commit
00dddaefae
88 changed files with 5971 additions and 572 deletions
|
|
@ -16,6 +16,7 @@ using API.DTOs.Scrobbling;
|
|||
using API.DTOs.Search;
|
||||
using API.DTOs.SeriesDetail;
|
||||
using API.DTOs.Settings;
|
||||
using API.DTOs.SideNav;
|
||||
using API.DTOs.Theme;
|
||||
using API.Entities;
|
||||
using API.Entities.Enums;
|
||||
|
|
@ -54,6 +55,7 @@ public class AutoMapperProfiles : Profile
|
|||
CreateMap<AgeRating, AgeRatingDto>();
|
||||
CreateMap<PublicationStatus, PublicationStatusDto>();
|
||||
CreateMap<MediaError, MediaErrorDto>();
|
||||
CreateMap<AppUserExternalSource, ExternalSourceDto>();
|
||||
CreateMap<ScrobbleHold, ScrobbleHoldDto>()
|
||||
.ForMember(dest => dest.LibraryId,
|
||||
opt =>
|
||||
|
|
|
|||
|
|
@ -29,20 +29,39 @@ public class AppUserBuilder : IEntityBuilder<AppUser>
|
|||
Progresses = new List<AppUserProgress>(),
|
||||
Devices = new List<Device>(),
|
||||
Id = 0,
|
||||
DashboardStreams = new List<AppUserDashboardStream>()
|
||||
DashboardStreams = new List<AppUserDashboardStream>(),
|
||||
SideNavStreams = new List<AppUserSideNavStream>()
|
||||
};
|
||||
foreach (var s in Seed.DefaultStreams)
|
||||
{
|
||||
_appUser.DashboardStreams.Add(s);
|
||||
}
|
||||
foreach (var s in Seed.DefaultSideNavStreams)
|
||||
{
|
||||
_appUser.SideNavStreams.Add(s);
|
||||
}
|
||||
}
|
||||
|
||||
public AppUserBuilder WithLibrary(Library library)
|
||||
public AppUserBuilder WithLibrary(Library library, bool createSideNavStream = false)
|
||||
{
|
||||
_appUser.Libraries.Add(library);
|
||||
if (!createSideNavStream) return this;
|
||||
|
||||
if (library.Id != 0 && _appUser.SideNavStreams.Any(s => s.LibraryId == library.Id)) return this;
|
||||
_appUser.SideNavStreams.Add(new AppUserSideNavStream()
|
||||
{
|
||||
Name = library.Name,
|
||||
IsProvided = false,
|
||||
Visible = true,
|
||||
LibraryId = library.Id,
|
||||
StreamType = SideNavStreamType.Library,
|
||||
Order = _appUser.SideNavStreams.Max(s => s.Order) + 1,
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public AppUserBuilder WithLocale(string locale)
|
||||
{
|
||||
_appUser.UserPreferences.Locale = locale;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue