diff --git a/Kyoo/Models/Resources/CollectionDE.cs b/Kyoo/Models/Resources/CollectionDE.cs index e1368a0c..3f23faf8 100644 --- a/Kyoo/Models/Resources/CollectionDE.cs +++ b/Kyoo/Models/Resources/CollectionDE.cs @@ -8,6 +8,7 @@ namespace Kyoo.Models public class CollectionDE : Collection { [JsonIgnore] [NotMergable] public virtual IEnumerable Links { get; set; } + [ExpressionRewrite(nameof(Links), nameof(CollectionLink.Show))] public override IEnumerable Shows { get => Links?.Select(x => x.Show); diff --git a/Kyoo/Models/Resources/LibraryDE.cs b/Kyoo/Models/Resources/LibraryDE.cs index c474c4fd..652eaa88 100644 --- a/Kyoo/Models/Resources/LibraryDE.cs +++ b/Kyoo/Models/Resources/LibraryDE.cs @@ -8,6 +8,7 @@ namespace Kyoo.Models public class LibraryDE : Library { [JsonIgnore] [NotMergable] public virtual IEnumerable ProviderLinks { get; set; } + [ExpressionRewrite(nameof(ProviderLinks), nameof(ProviderLink.Provider))] public override IEnumerable Providers { get => ProviderLinks?.Select(x => x.Provider); @@ -15,6 +16,7 @@ namespace Kyoo.Models } [JsonIgnore] [NotMergable] public virtual IEnumerable Links { get; set; } + [ExpressionRewrite(nameof(Links), nameof(LibraryLink.Show))] public override IEnumerable Shows { get => Links?.Where(x => x.Show != null).Select(x => x.Show); @@ -22,6 +24,7 @@ namespace Kyoo.Models value?.Select(x => new LibraryLink(this, x)), Links?.Where(x => x.Show == null)); } + [ExpressionRewrite(nameof(Links), nameof(LibraryLink.Collection))] public override IEnumerable Collections { get => Links?.Where(x => x.Collection != null).Select(x => x.Collection); diff --git a/Kyoo/Models/Resources/ShowDE.cs b/Kyoo/Models/Resources/ShowDE.cs index 7d43f25c..c7c3b170 100644 --- a/Kyoo/Models/Resources/ShowDE.cs +++ b/Kyoo/Models/Resources/ShowDE.cs @@ -19,6 +19,7 @@ namespace Kyoo.Models } [JsonIgnore] [NotMergable] public virtual IEnumerable LibraryLinks { get; set; } + [ExpressionRewrite(nameof(LibraryLinks), nameof(LibraryLink.Library))] public override IEnumerable Libraries { get => LibraryLinks?.Select(x => x.Library); @@ -26,7 +27,7 @@ namespace Kyoo.Models } [JsonIgnore] [NotMergable] public virtual IEnumerable CollectionLinks { get; set; } - + [ExpressionRewrite(nameof(CollectionLinks), nameof(CollectionLink.Collection))] public override IEnumerable Collections { get => CollectionLinks?.Select(x => x.Collection);