public void Populate(JMMServerBinary.Contract_AnimeGroup contract) { // readonly members this.AnimeGroupID = contract.AnimeGroupID; this.AnimeGroupParentID = contract.AnimeGroupParentID; this.DefaultAnimeSeriesID = contract.DefaultAnimeSeriesID; this.DateTimeUpdated = contract.DateTimeUpdated; this.MissingEpisodeCount = contract.MissingEpisodeCount; this.MissingEpisodeCountGroups = contract.MissingEpisodeCountGroups; this.PlayedCount = contract.PlayedCount; this.StoppedCount = contract.StoppedCount; this.UnwatchedEpisodeCount = contract.UnwatchedEpisodeCount; this.WatchedCount = contract.WatchedCount; this.EpisodeAddedDate = contract.EpisodeAddedDate; this.WatchedDate = contract.WatchedDate; this.WatchedEpisodeCount = contract.WatchedEpisodeCount; this.Stat_AirDate_Min = contract.Stat_AirDate_Min; this.Stat_AirDate_Max = contract.Stat_AirDate_Max; this.Stat_EndDate = contract.Stat_EndDate; this.Stat_SeriesCreatedDate = contract.Stat_SeriesCreatedDate; this.Stat_UserVoteOverall = contract.Stat_UserVoteOverall; this.Stat_UserVotePermanent = contract.Stat_UserVotePermanent; this.Stat_UserVoteTemporary = contract.Stat_UserVoteTemporary; this.Stat_AllCategories = contract.Stat_AllCategories; this.Stat_AllTitles = contract.Stat_AllTitles; this.Stat_IsComplete = contract.Stat_IsComplete; this.Stat_HasFinishedAiring = contract.Stat_HasFinishedAiring; this.Stat_AllVideoQuality = contract.Stat_AllVideoQuality; this.Stat_AllVideoQuality_Episodes = contract.Stat_AllVideoQuality_Episodes; this.Stat_AudioLanguages = contract.Stat_AudioLanguages; this.Stat_SubtitleLanguages = contract.Stat_SubtitleLanguages; this.Stat_HasTvDBLink = contract.Stat_HasTvDBLink; this.Stat_HasMovieDBLink = contract.Stat_HasMovieDBLink; this.Stat_HasMovieDBOrTvDBLink = contract.Stat_HasMovieDBOrTvDBLink; this.Stat_SeriesCount = contract.Stat_SeriesCount; this.Stat_EpisodeCount = contract.Stat_EpisodeCount; this.Stat_AniDBRating = contract.Stat_AniDBRating; // editable members this.GroupName = contract.GroupName; this.IsFave = contract.IsFave; this.SortName = contract.SortName; this.Description = contract.Description; //this.UserHasVoted = this.Stat_UserVotePermanent.HasValue; if (contract.SeriesForNameOverride != null) { this.SeriesForNameOverride = new AnimeSeriesVM(contract.SeriesForNameOverride); this.GroupName = this.SeriesForNameOverride.SeriesName; this.SortName = this.GroupName; } }
public static AnimeGroupVM GetGroup(int animeGroupID) { try { JMMServerBinary.Contract_AnimeGroup rawGroup = JMMServerVM.Instance.clientBinaryHTTP.GetGroup(animeGroupID, JMMServerVM.Instance.CurrentUser.JMMUserID); if (rawGroup == null) { return(null); } return(new AnimeGroupVM(rawGroup)); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write(ex.ToString()); } return(null); }
public void Populate(JMMServerBinary.Contract_AnimeGroup contract) { if (contract.AnimeGroupID == 189) { Debug.Print(""); } // readonly members this.AnimeGroupID = contract.AnimeGroupID; this.AnimeGroupParentID = contract.AnimeGroupParentID; this.DateTimeUpdated = contract.DateTimeUpdated; this.IsManuallyNamed = contract.IsManuallyNamed; this.MissingEpisodeCount = contract.MissingEpisodeCount; this.MissingEpisodeCountGroups = contract.MissingEpisodeCountGroups; this.PlayedCount = contract.PlayedCount; this.StoppedCount = contract.StoppedCount; this.UnwatchedEpisodeCount = contract.UnwatchedEpisodeCount; this.WatchedCount = contract.WatchedCount; this.EpisodeAddedDate = contract.EpisodeAddedDate; this.WatchedDate = contract.WatchedDate; this.WatchedEpisodeCount = contract.WatchedEpisodeCount; this.Stat_AirDate_Min = contract.Stat_AirDate_Min; this.Stat_AirDate_Max = contract.Stat_AirDate_Max; this.Stat_EndDate = contract.Stat_EndDate; this.Stat_SeriesCreatedDate = contract.Stat_SeriesCreatedDate; this.Stat_UserVoteOverall = contract.Stat_UserVoteOverall; this.Stat_UserVotePermanent = contract.Stat_UserVotePermanent; this.Stat_UserVoteTemporary = contract.Stat_UserVoteTemporary; this.Stat_AllTags = new HashSet <string>(contract.Stat_AllTags, StringComparer.InvariantCultureIgnoreCase); this.Stat_AllCustomTags = new HashSet <string>(contract.Stat_AllCustomTags, StringComparer.InvariantCultureIgnoreCase); this.Stat_AllTitles = new HashSet <string>(contract.Stat_AllTitles, StringComparer.InvariantCultureIgnoreCase); this.Stat_IsComplete = contract.Stat_IsComplete; this.Stat_HasFinishedAiring = contract.Stat_HasFinishedAiring; this.Stat_IsCurrentlyAiring = contract.Stat_IsCurrentlyAiring; this.Stat_AllVideoQuality = new HashSet <string>(contract.Stat_AllVideoQuality); this.Stat_AllVideoQualityEpisodes = new HashSet <string>(contract.Stat_AllVideoQuality_Episodes); this.Stat_AudioLanguages = new HashSet <string>(contract.Stat_AudioLanguages); this.Stat_SubtitleLanguages = new HashSet <string>(contract.Stat_SubtitleLanguages); this.Stat_HasTvDBLink = contract.Stat_HasTvDBLink; this.Stat_HasMALLink = contract.Stat_HasMALLink; this.Stat_HasMovieDBLink = contract.Stat_HasMovieDBLink; this.Stat_HasMovieDBOrTvDBLink = contract.Stat_HasMovieDBOrTvDBLink; this.Stat_SeriesCount = contract.Stat_SeriesCount; this.Stat_EpisodeCount = contract.Stat_EpisodeCount; this.Stat_AniDBRating = contract.Stat_AniDBRating; // editable members this.GroupName = contract.GroupName; this.IsFave = contract.IsFave; this.SortName = contract.SortName; this.DefaultAnimeSeriesID = contract.DefaultAnimeSeriesID; if (contract.DefaultAnimeSeriesID.HasValue) { this.HasDefaultSeries = contract.DefaultAnimeSeriesID.HasValue; } this.Description = contract.Description; this.UserHasVoted = this.Stat_UserVotePermanent.HasValue; this.UserHasVotedAny = this.Stat_UserVotePermanent.HasValue || this.Stat_UserVoteTemporary.HasValue; }
public AnimeGroupVM(JMMServerBinary.Contract_AnimeGroup contract) { Populate(contract); }