/// <summary>Add a show to the user's watched history by ID</summary>
        /// <param name="showId">The show ID</param>
        /// <param name="showIdType">The show ID type</param>
        /// <param name="seasonNumbers">If set, the action will be applied to the specified season numbers instead of the show itself</param>
        /// <returns>See summary</returns>
        public async Task <TraktAddResponse> MarkWatchedByShowIdAsync(int showId, TraktNumericShowIdType showIdType, IEnumerable <int> seasonNumbers = null)
        {
            var obj = TraktShowFactory.FromId <TraktShowWithWatchedMetadata>(showId, showIdType);

            if (seasonNumbers != null)
            {
                obj.Seasons = seasonNumbers.Select(s => new TraktSeasonWithWatchedMetadata {
                    SeasonNumber = s
                }).ToList();
            }
            return(await MarkWatchedAsync(obj));
        }
Ejemplo n.º 2
0
 /// <summary>Create an collection of <see cref="TraktShow"/> subclass instances from a collecion of IDs</summary>
 /// <typeparam name="T">A subclass of <see cref="TraktMovie"/> to be created</typeparam>
 /// <param name="showIds">A collection of show IDs</param>
 /// <param name="showIdType">The show ID type</param>
 /// <returns>See summary</returns>
 public static IEnumerable <T> FromIds <T>(IEnumerable <int> showIds, TraktNumericShowIdType showIdType) where T : TraktShow
 {
     return(showIds == null ? null : showIds.Select(showId => FromId <T>(showId, showIdType)));
 }
 /// <summary>Remove one or more items from a custom list</summary>
 /// <param name="listId">The list ID</param>
 /// <param name="showId">The show ID</param>
 /// <param name="showIdType">The show ID type</param>
 /// <returns>See summary</returns>
 public async Task <TraktRemoveResponse> RemoveFromListByShowIdAsync(string listId, int showId, TraktNumericShowIdType showIdType)
 {
     return(await RemoveFromListAsync(listId, TraktShowFactory.FromId(showId, showIdType)));
 }
Ejemplo n.º 4
0
 /// <summary>Add a new comment to a show. If you add a review, it needs to be at least 200 words. Also make sure to allow and encourage spoilers to be indicated in your app.</summary>
 /// <param name="showId">The show ID</param>
 /// <param name="showIdType">The show ID type</param>
 /// <param name="comment">The comment</param>
 /// <param name="spoiler">Set to <c>true</c> if the comment contains spoilers</param>
 /// <param name="review">Set to <c>true</c> if the comment is a review</param>
 /// <returns>See summary</returns>
 public async Task <TraktComment> PostShowCommentAsync(int showId, TraktNumericShowIdType showIdType, string comment, bool?spoiler = null, bool?review = null)
 {
     return(await PostShowCommentAsync(TraktShowFactory.FromId(showId, showIdType), comment, spoiler, review));
 }