Esempio n. 1
0
        public void Populate(JMMServerBinary.Contract_AnimeEpisode contract)
        {
            try
            {
                //Cloner.Clone(contract, this);
                this.AniDB_EpisodeID        = contract.AniDB_EpisodeID;
                this.AnimeEpisodeID         = contract.AnimeEpisodeID;
                this.AnimeSeriesID          = contract.AnimeSeriesID;
                this.DateTimeUpdated        = contract.DateTimeUpdated;
                this.Description            = "";
                this.EpisodeNumber          = contract.EpisodeNumber;
                this.EpisodeType            = contract.EpisodeType;
                this.IsWatched              = contract.IsWatched;
                this.LocalFileCount         = contract.LocalFileCount;
                this.PlayedCount            = contract.PlayedCount;
                this.StoppedCount           = contract.StoppedCount;
                this.WatchedCount           = contract.WatchedCount;
                this.WatchedDate            = contract.WatchedDate;
                this.UnwatchedEpCountSeries = contract.UnwatchedEpCountSeries;

                this.AniDB_LengthSeconds = contract.AniDB_LengthSeconds;
                this.AniDB_Rating        = contract.AniDB_Rating;
                this.AniDB_Votes         = contract.AniDB_Votes;
                this.AniDB_RomajiName    = contract.AniDB_RomajiName;
                this.AniDB_EnglishName   = contract.AniDB_EnglishName;
                this.AniDB_AirDate       = contract.AniDB_AirDate;

                this.EpisodeOverview      = "";
                this.EpisodeImageLocation = "";

                if (AniDB_EnglishName.Trim().Length > 0)
                {
                    EpisodeName = AniDB_EnglishName;
                }
                else
                {
                    EpisodeName = AniDB_RomajiName;
                }
            }
            catch (Exception ex)
            {
                BaseConfig.MyAnimeLog.Write(ex.ToString());
            }
        }
Esempio n. 2
0
        public void Populate(JMMServerBinary.Contract_AnimeEpisode contract)
        {
            try
            {
                //Cloner.Clone(contract, this);
                this.AniDB_EpisodeID        = contract.AniDB_EpisodeID;
                this.AnimeEpisodeID         = contract.AnimeEpisodeID;
                this.AnimeSeriesID          = contract.AnimeSeriesID;
                this.DateTimeUpdated        = contract.DateTimeUpdated;
                this.Description            = "";
                this.EpisodeNumber          = contract.EpisodeNumber;
                this.EpisodeType            = contract.EpisodeType;
                this.IsWatched              = contract.IsWatched;
                this.UnwatchedEpCountSeries = contract.UnwatchedEpCountSeries;

                this.AniDB_LengthSeconds = contract.AniDB_LengthSeconds;
                this.AniDB_Rating        = contract.AniDB_Rating;
                this.AniDB_Votes         = contract.AniDB_Votes;
                this.AniDB_RomajiName    = contract.AniDB_RomajiName;
                this.AniDB_EnglishName   = contract.AniDB_EnglishName;
                this.AniDB_AirDate       = contract.AniDB_AirDate;
                if (contract.AniDB_AirDate.HasValue)
                {
                    this.AniDB_AirDateWithDefault = contract.AniDB_AirDate;
                }
                else
                {
                    this.AniDB_AirDateWithDefault = DateTime.MaxValue;
                }


                if (AniDB_AirDate.HasValue)
                {
                    AirDateAsString = AniDB_AirDate.Value.ToString("dd MMM yyyy", Globals.Culture);
                }
                else
                {
                    AirDateAsString = "";
                }

                this.LocalFileCount = contract.LocalFileCount;
                this.PlayedCount    = contract.PlayedCount;
                this.StoppedCount   = contract.StoppedCount;
                this.WatchedCount   = contract.WatchedCount;
                this.WatchedDate    = contract.WatchedDate;

                //logger.Trace("Getting AniDBRatingFormatted for ep#: {0}", this.EpisodeNumber);

                AniDBRatingFormatted = string.Format("{0}: {1} ({2} {3})", JMMClient.Properties.Resources.Rating, AniDB_Rating, AniDB_Votes, JMMClient.Properties.Resources.Votes);


                // episode image / overview in summary
                ShowEpisodeImageInSummary    = false;
                ShowEpisodeOverviewInSummary = false;
                if (UserSettingsVM.Instance.EpisodeImageOverviewStyle == (int)EpisodeDisplayStyle.Never)
                {
                    ShowEpisodeImageInSummary    = false;
                    ShowEpisodeOverviewInSummary = false;
                }
                else
                {
                    if (UserSettingsVM.Instance.EpisodeImageOverviewStyle == (int)EpisodeDisplayStyle.Always)
                    {
                        ShowEpisodeImageInSummary    = true;
                        ShowEpisodeOverviewInSummary = true;
                    }

                    if (!Watched && UserSettingsVM.Instance.HideEpisodeImageWhenUnwatched)
                    {
                        ShowEpisodeImageInSummary = false;
                    }
                    if (!Watched && UserSettingsVM.Instance.HideEpisodeOverviewWhenUnwatched)
                    {
                        ShowEpisodeOverviewInSummary = false;
                    }
                }

                // episode image / overview in expanded
                ShowEpisodeImageInExpanded    = false;
                ShowEpisodeOverviewInExpanded = false;
                if (UserSettingsVM.Instance.EpisodeImageOverviewStyle == (int)EpisodeDisplayStyle.Never)
                {
                    ShowEpisodeImageInExpanded    = false;
                    ShowEpisodeOverviewInExpanded = false;
                }
                else
                {
                    if (UserSettingsVM.Instance.EpisodeImageOverviewStyle == (int)EpisodeDisplayStyle.Always ||
                        UserSettingsVM.Instance.EpisodeImageOverviewStyle == (int)EpisodeDisplayStyle.InExpanded)
                    {
                        ShowEpisodeImageInExpanded    = true;
                        ShowEpisodeOverviewInExpanded = true;
                    }

                    if (!Watched && UserSettingsVM.Instance.HideEpisodeImageWhenUnwatched)
                    {
                        ShowEpisodeImageInExpanded = false;
                    }
                    if (!Watched && UserSettingsVM.Instance.HideEpisodeOverviewWhenUnwatched)
                    {
                        ShowEpisodeOverviewInExpanded = false;
                    }
                }

                ShowEpisodeImageInDashboard = ShowEpisodeImageInExpanded;

                if (AniDB_EnglishName.Trim().Length > 0)
                {
                    EpisodeName = AniDB_EnglishName;
                }
                else
                {
                    EpisodeName = AniDB_RomajiName;
                }
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }