[CHANGE] Small optimizations
This commit is contained in:
@@ -228,7 +228,7 @@ public class LibraryService : ILibraryService
|
|||||||
return ResultError.Error(e);
|
return ResultError.Error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context.Channels.Any(c => c.Id == innertubeChannel.Id))
|
if (channelResult.IsSuccess)
|
||||||
{
|
{
|
||||||
context.Channels.Update(channelEntity);
|
context.Channels.Update(channelEntity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class ClientService(IServiceScopeFactory scopeFactory, ILogger<ClientServ
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<HttpCookieEntity> httpCookies = [];
|
List<HttpCookieEntity> httpCookies = [];
|
||||||
httpCookies.AddRange(client.CookieContainer.GetAllCookies()
|
httpCookies.AddRange(client.CookieContainer.GetAllCookies().Where(c => c.Expires != DateTime.MinValue)
|
||||||
.ToList()
|
.ToList()
|
||||||
.Select(cookie => new HttpCookieEntity
|
.Select(cookie => new HttpCookieEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class AuditInterceptor : SaveChangesInterceptor
|
|||||||
break;
|
break;
|
||||||
case EntityState.Modified:
|
case EntityState.Modified:
|
||||||
audits.AddRange(allowedProperties
|
audits.AddRange(allowedProperties
|
||||||
.Where(p => p.IsModified)
|
.Where(p => p.IsModified && !Equals(p.OriginalValue, p.CurrentValue))
|
||||||
.Select(p => CreateAudit(entry, p, entry.State, primaryKey))
|
.Select(p => CreateAudit(entry, p, entry.State, primaryKey))
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user