diff --git a/Kyoo.Common/Models/Attributes/EditableRelation.cs b/Kyoo.Common/Models/Attributes/EditableRelation.cs index 78b479e9..4275dca4 100644 --- a/Kyoo.Common/Models/Attributes/EditableRelation.cs +++ b/Kyoo.Common/Models/Attributes/EditableRelation.cs @@ -2,5 +2,6 @@ using System; namespace Kyoo.Models.Attributes { + [AttributeUsage(AttributeTargets.Property, Inherited = false)] public class EditableRelation : Attribute { } } \ No newline at end of file diff --git a/Kyoo.CommonAPI/LocalRepository.cs b/Kyoo.CommonAPI/LocalRepository.cs index 8cb6b794..4927da83 100644 --- a/Kyoo.CommonAPI/LocalRepository.cs +++ b/Kyoo.CommonAPI/LocalRepository.cs @@ -231,10 +231,9 @@ namespace Kyoo.Controllers foreach (PropertyInfo property in typeof(T).GetProperties() .Where(x => typeof(IEnumerable).IsAssignableFrom(x.PropertyType) - && !typeof(string).IsAssignableFrom(x.PropertyType))) + && !typeof(string).IsAssignableFrom(x.PropertyType) + && x.GetCustomAttribute() != null)) { - // TODO For DE classes (like ShowDE), the basic ienumerable should not be verified (for exemple, GenreLinks should be checked & not Genres). - Console.WriteLine($"Validating {property.Name}"); object value = property.GetValue(resource); if (value == null || value is ICollection || Utility.IsOfGenericType(value, typeof(ICollection<>))) continue;