Fixing some issues with the crawler & most issues of the ressource editor

This commit is contained in:
Zoe Roux
2020-12-25 23:46:32 +01:00
parent c084208013
commit a6d3107329
3 changed files with 16 additions and 21 deletions
+5 -7
View File
@@ -159,17 +159,15 @@ namespace Kyoo.Controllers
if (old == null)
throw new ItemNotFound($"No resource found with the ID {edited.ID}.");
IEnumerable<NavigationEntry> relations = Database.Entry(old).Collections
.Concat(Database.Entry(old).Navigations);
foreach (NavigationEntry navigation in relations)
if (navigation.Metadata.PropertyInfo.GetCustomAttribute<EditableRelation>() != null)
await navigation.LoadAsync();
foreach (NavigationEntry navigation in Database.Entry(old).Navigations)
if (navigation.Metadata.PropertyInfo.GetCustomAttribute<EditableRelation>() != null
&& navigation.Metadata.GetGetter().GetClrValue(edited) != default)
await navigation.LoadAsync();
if (resetOld)
Utility.Nullify(old);
Utility.Complete(old, edited);
// TODO Validation set values & setting values trigger a change round in the OEM. A change round should only be triggered if the item is actually different.
await Validate(old);
await Database.SaveChangesAsync();
return old;