コード例 #1
0
        protected TraktSyncHistoryRemovePostBuilder AddEpisodeOrIgnore(ITraktEpisode episode)
        {
            if (ContainsEpisode(episode))
            {
                return(this);
            }

            var historyEpisode = new TraktSyncHistoryPostEpisode
            {
                Ids = episode.Ids
            };

            (_historyPost.Episodes as List <ITraktSyncHistoryPostEpisode>)?.Add(historyEpisode);
            return(this);
        }
コード例 #2
0
        protected TraktSyncHistoryPostBuilder AddEpisodeOrIgnore(ITraktEpisode episode, DateTime?watchedAt = null)
        {
            if (ContainsEpisode(episode))
            {
                return(this);
            }

            var historyEpisode = new TraktSyncHistoryPostEpisode
            {
                Ids = episode.Ids
            };

            if (watchedAt.HasValue)
            {
                historyEpisode.WatchedAt = watchedAt.Value.ToUniversalTime();
            }

            (_historyPost.Episodes as List <ITraktSyncHistoryPostEpisode>)?.Add(historyEpisode);

            return(this);
        }