diff --git a/JMMServer/Entities/AniDB_Anime.cs b/JMMServer/Entities/AniDB_Anime.cs index 43cb1f59d..3fc8ac3e3 100644 --- a/JMMServer/Entities/AniDB_Anime.cs +++ b/JMMServer/Entities/AniDB_Anime.cs @@ -2113,7 +2113,7 @@ private Contract_AniDBAnime GenerateContract(List titles, Def MovieFanart = a.ToContract(), AniDB_Anime_DefaultImageID = a.MovieDB_FanartID }) - .ToList() ?? new List(); + .ToList(); } else // Not a movie { @@ -2123,17 +2123,20 @@ private Contract_AniDBAnime GenerateContract(List titles, Def TVFanart = a.ToContract(), AniDB_Anime_DefaultImageID = a.TvDB_ImageFanartID }) - .ToList() ?? new List(); + .ToList(); contract.Banners = tvDbBanners?.Select(a => new Contract_AniDB_Anime_DefaultImage { ImageType = (int)JMMImageType.TvDB_FanArt, TVWideBanner = a.ToContract(), AniDB_Anime_DefaultImageID = a.TvDB_ImageWideBannerID }) - .ToList() ?? new List(); + .ToList(); } - return contract; + if (contract.Fanarts?.Count == 0) contract.Fanarts = null; + if (contract.Banners?.Count == 0) contract.Banners = null; + + return contract; } public List GetCharactersContract()