public void Populate(JMMServerBinary.Contract_AnimeSeries contract) { AniDB_Anime = new AniDB_AnimeVM(contract.AniDBAnime); NotifyPropertyChanged("AniDB_Anime"); MainListHelperVM.Instance.AllAnimeDictionary[AniDB_Anime.AnimeID] = AniDB_Anime; if (contract.CrossRefAniDBTvDBV2 != null) { foreach (JMMClient.JMMServerBinary.Contract_CrossRef_AniDB_TvDBV2 contractTV in contract.CrossRefAniDBTvDBV2) { CrossRef_AniDB_TvDBV2.Add(new CrossRef_AniDB_TvDBVMV2(contractTV)); } } if (contract.TvDB_Series != null) { foreach (JMMClient.JMMServerBinary.Contract_TvDB_Series contractSer in contract.TvDB_Series) { TvDBSeriesV2.Add(new TvDB_SeriesVM(contractSer)); } } if (contract.CrossRefAniDBMovieDB != null) { CrossRef_AniDB_MovieDB = new CrossRef_AniDB_OtherVM(contract.CrossRefAniDBMovieDB); } else { CrossRef_AniDB_MovieDB = null; } if (contract.CrossRefAniDBMAL != null) { CrossRef_AniDB_MAL = new List <CrossRef_AniDB_MALVM>(); foreach (JMMServerBinary.Contract_CrossRef_AniDB_MAL contractTemp in contract.CrossRefAniDBMAL) { CrossRef_AniDB_MAL.Add(new CrossRef_AniDB_MALVM(contractTemp)); } } else { CrossRef_AniDB_MAL = null; } this.AniDB_ID = contract.AniDB_ID; this.AnimeGroupID = contract.AnimeGroupID; this.AnimeSeriesID = contract.AnimeSeriesID; this.DateTimeUpdated = contract.DateTimeUpdated; this.DateTimeCreated = contract.DateTimeCreated; this.DefaultAudioLanguage = contract.DefaultAudioLanguage; this.DefaultSubtitleLanguage = contract.DefaultSubtitleLanguage; this.SeriesNameOverride = contract.SeriesNameOverride; this.DefaultFolder = contract.DefaultFolder; IsSeriesNameOverridden = !string.IsNullOrEmpty(SeriesNameOverride); IsSeriesNameNotOverridden = string.IsNullOrEmpty(SeriesNameOverride); this.LatestLocalEpisodeNumber = contract.LatestLocalEpisodeNumber; this.PlayedCount = contract.PlayedCount; this.StoppedCount = contract.StoppedCount; this.UnwatchedEpisodeCount = contract.UnwatchedEpisodeCount; this.WatchedCount = contract.WatchedCount; this.WatchedDate = contract.WatchedDate; this.EpisodeAddedDate = contract.EpisodeAddedDate; this.WatchedEpisodeCount = contract.WatchedEpisodeCount; this.MissingEpisodeCount = contract.MissingEpisodeCount; this.MissingEpisodeCountGroups = contract.MissingEpisodeCountGroups; HasMissingEpisodesAny = (MissingEpisodeCount > 0 || MissingEpisodeCountGroups > 0); HasMissingEpisodesAllDifferentToGroups = (MissingEpisodeCount > 0 && MissingEpisodeCount != MissingEpisodeCountGroups); HasMissingEpisodesGroups = MissingEpisodeCountGroups > 0; //PosterPath = AniDB_Anime.DefaultPosterPath; SetSeriesNames(); }
public void Populate(JMMServerBinary.Contract_AnimeSeries contract) { AniDB_Anime = new AniDB_AnimeVM(contract.AniDBAnime); if (contract.CrossRefAniDBTvDBV2 != null) { foreach (JMMServerBinary.Contract_CrossRef_AniDB_TvDBV2 contractTV in contract.CrossRefAniDBTvDBV2) { CrossRef_AniDB_TvDBV2.Add(new CrossRef_AniDB_TvDBVMV2(contractTV)); } } if (contract.TvDB_Series != null) { foreach (JMMServerBinary.Contract_TvDB_Series contractSer in contract.TvDB_Series) { TvDBSeriesV2.Add(new TvDB_SeriesVM(contractSer)); } } if (contract.CrossRefAniDBMovieDB != null) { CrossRef_AniDB_MovieDB = new CrossRef_AniDB_OtherVM(contract.CrossRefAniDBMovieDB); } else { CrossRef_AniDB_MovieDB = null; } if (contract.CrossRefAniDBMAL != null) { CrossRef_AniDB_MAL = new List <CrossRef_AniDB_MALVM>(); foreach (JMMServerBinary.Contract_CrossRef_AniDB_MAL contractTemp in contract.CrossRefAniDBMAL) { CrossRef_AniDB_MAL.Add(new CrossRef_AniDB_MALVM(contractTemp)); } } else { CrossRef_AniDB_MAL = null; } // read only members this.AniDB_ID = contract.AniDB_ID; this.AnimeGroupID = contract.AnimeGroupID; this.AnimeSeriesID = contract.AnimeSeriesID; this.DateTimeUpdated = contract.DateTimeUpdated; this.DateTimeCreated = contract.DateTimeCreated; this.DefaultAudioLanguage = contract.DefaultAudioLanguage; this.DefaultSubtitleLanguage = contract.DefaultSubtitleLanguage; this.SeriesNameOverride = contract.SeriesNameOverride; this.LatestLocalEpisodeNumber = contract.LatestLocalEpisodeNumber; this.PlayedCount = contract.PlayedCount; this.StoppedCount = contract.StoppedCount; this.UnwatchedEpisodeCount = contract.UnwatchedEpisodeCount; this.WatchedCount = contract.WatchedCount; this.WatchedDate = contract.WatchedDate; this.EpisodeAddedDate = contract.EpisodeAddedDate; this.WatchedEpisodeCount = contract.WatchedEpisodeCount; this.MissingEpisodeCount = contract.MissingEpisodeCount; this.MissingEpisodeCountGroups = contract.MissingEpisodeCountGroups; HasMissingEpisodesAny = (MissingEpisodeCount > 0 || MissingEpisodeCountGroups > 0); HasMissingEpisodesAllDifferentToGroups = (MissingEpisodeCount > 0 && MissingEpisodeCount != MissingEpisodeCountGroups); HasMissingEpisodesGroups = MissingEpisodeCountGroups > 0; PosterPath = AniDB_Anime.DefaultPosterPath; }