Fixed extremly slow .clubinfo, however they're case sensitive now. Just target a user for best experience.
This commit is contained in:
parent
2d8b9d677c
commit
763d529c74
@ -117,12 +117,12 @@ namespace NadekoBot.Modules.Xp
|
||||
.AddField("Owner", club.Owner.ToString(), true)
|
||||
.AddField("Level Req.", club.MinimumLevelReq.ToString(), true)
|
||||
.AddField("Members", string.Join("\n", club.Users
|
||||
.OrderByDescending(x => x.IsClubAdmin || club.OwnerId == x.Id)
|
||||
.Skip(page * 10)
|
||||
.Take(10)
|
||||
.OrderByDescending(x => x.IsClubAdmin)
|
||||
.Select(x =>
|
||||
{
|
||||
if (x.IsClubAdmin)
|
||||
if (x.IsClubAdmin || club.OwnerId == x.Id)
|
||||
return x.ToString() + "⭐";
|
||||
return x.ToString();
|
||||
})), false);
|
||||
|
@ -113,7 +113,7 @@ namespace NadekoBot.Modules.Xp.Services
|
||||
|
||||
using (var uow = _db.UnitOfWork)
|
||||
{
|
||||
club = uow.Clubs.GetByName(name.Trim().ToLowerInvariant(), discrim);
|
||||
club = uow.Clubs.GetByName(name, discrim);
|
||||
if (club == null)
|
||||
return false;
|
||||
else
|
||||
|
@ -52,10 +52,11 @@ namespace NadekoBot.Services.Database.Repositories.Impl
|
||||
{
|
||||
if (func == null)
|
||||
return _set
|
||||
.Where(x => x.Name == name && x.Discrim == discrim)
|
||||
.Include(x => x.Users)
|
||||
.Include(x => x.Bans)
|
||||
.Include(x => x.Applicants)
|
||||
.Include(x => x.Users)
|
||||
.FirstOrDefault(x => x.Name.ToLowerInvariant() == name && x.Discrim == discrim);
|
||||
.FirstOrDefault();
|
||||
|
||||
return func(_set).FirstOrDefault(x => x.Name == name && x.Discrim == discrim);
|
||||
}
|
||||
@ -72,7 +73,8 @@ namespace NadekoBot.Services.Database.Repositories.Impl
|
||||
public ClubInfo GetByMember(ulong userId, Func<DbSet<ClubInfo>, IQueryable<ClubInfo>> func = null)
|
||||
{
|
||||
if (func == null)
|
||||
return _set.Include(x => x.Users)
|
||||
return _set
|
||||
.Include(x => x.Users)
|
||||
.Include(x => x.Bans)
|
||||
.Include(x => x.Applicants)
|
||||
.FirstOrDefault(x => x.Users.Any(y => y.UserId == userId));
|
||||
|
Loading…
Reference in New Issue
Block a user