diff --git a/Kyoo.Common/Models/Resources/IResource.cs b/Kyoo.Common/Models/Resources/IResource.cs index f20179a7..83806ff5 100644 --- a/Kyoo.Common/Models/Resources/IResource.cs +++ b/Kyoo.Common/Models/Resources/IResource.cs @@ -29,8 +29,6 @@ namespace Kyoo.Models return false; if (ReferenceEquals(y, null)) return false; - if (x.GetType() != y.GetType()) - return false; return x.ID == y.ID || x.Slug == y.Slug; } @@ -53,8 +51,6 @@ namespace Kyoo.Models return false; if (ReferenceEquals(y, null)) return false; - if (x.GetType() != y.GetType()) - return false; return Utility.LinkEquals(x.Parent, x.ParentID, y.Parent, y.ParentID) && Utility.LinkEquals(x.Child, x.ChildID, y.Child, y.ChildID); } diff --git a/Kyoo.Common/Models/Resources/Show.cs b/Kyoo.Common/Models/Resources/Show.cs index 71ebfe68..69bf72ec 100644 --- a/Kyoo.Common/Models/Resources/Show.cs +++ b/Kyoo.Common/Models/Resources/Show.cs @@ -9,7 +9,7 @@ namespace Kyoo.Models public int ID { get; set; } public string Slug { get; set; } public string Title { get; set; } - public IEnumerable Aliases { get; set; } + [EditableRelation] public IEnumerable Aliases { get; set; } [JsonIgnore] public string Path { get; set; } public string Overview { get; set; } public Status? Status { get; set; } diff --git a/Kyoo.CommonAPI/LocalRepository.cs b/Kyoo.CommonAPI/LocalRepository.cs index add826bf..5d81f7c4 100644 --- a/Kyoo.CommonAPI/LocalRepository.cs +++ b/Kyoo.CommonAPI/LocalRepository.cs @@ -175,22 +175,15 @@ namespace Kyoo.Controllers if (getter.HasDefaultValue(edited)) continue; await navigation.LoadAsync(); + // TODO this may be usless for lists since the API does not return IDs but the + // TODO LinkEquality does not check slugs (their are lazy loaded and only the ID is available) if (Utility.ResourceEquals(getter.GetClrValue(edited), getter.GetClrValue(old))) - { navigation.Metadata.PropertyInfo.SetValue(edited, default); - Console.WriteLine($"Loaded: {navigation.Metadata.Name}"); - } - else - Console.WriteLine($"Using: {navigation.Metadata.Name}"); } else - { navigation.Metadata.PropertyInfo.SetValue(edited, default); - Console.WriteLine($"Skipping: {navigation.Metadata.Name}"); - } } - Console.WriteLine("Loading done."); if (resetOld) Utility.Nullify(old); Utility.Complete(old, edited);