Пример #1
0
        protected TraktSyncHistoryRemovePostBuilder AddShowOrIgnore(TraktShow show)
        {
            if (ContainsShow(show))
            {
                return(this);
            }

            var historyShow = new TraktSyncHistoryPostShow();

            historyShow.Ids   = show.Ids;
            historyShow.Title = show.Title;
            historyShow.Year  = show.Year;

            (_historyPost.Shows as List <TraktSyncHistoryPostShow>).Add(historyShow);

            return(this);
        }
Пример #2
0
        protected void CreateOrSetShow(TraktShow show, IEnumerable <TraktSyncHistoryPostShowSeason> showSeasons)
        {
            var existingShow = _historyPost.Shows.Where(s => s.Ids == show.Ids).FirstOrDefault();

            if (existingShow != null)
            {
                existingShow.Seasons = showSeasons;
            }
            else
            {
                var historyShow = new TraktSyncHistoryPostShow();
                historyShow.Ids   = show.Ids;
                historyShow.Title = show.Title;
                historyShow.Year  = show.Year;

                historyShow.Seasons = showSeasons;
                (_historyPost.Shows as List <TraktSyncHistoryPostShow>).Add(historyShow);
            }
        }
Пример #3
0
        protected TraktSyncHistoryPostBuilder AddShowOrIgnore(TraktShow show, DateTime?watchedAt = null)
        {
            if (ContainsShow(show))
            {
                return(this);
            }

            var historyShow = new TraktSyncHistoryPostShow();

            historyShow.Ids   = show.Ids;
            historyShow.Title = show.Title;
            historyShow.Year  = show.Year;

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

            (_historyPost.Shows as List <TraktSyncHistoryPostShow>).Add(historyShow);

            return(this);
        }