Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
        }