/// <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, string showId, TraktTextShowIdType showIdType = TraktTextShowIdType.Auto) { return(await RemoveFromListAsync(listId, TraktShowFactory.FromId(showId, showIdType))); }
/// <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(string showId, TraktTextShowIdType showIdType, string comment, bool?spoiler = null, bool?review = null) { return(await PostShowCommentAsync(TraktShowFactory.FromId(showId, showIdType), comment, spoiler, review)); }
/// <summary>Remove a show from the user's watchlist 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 <TraktRemoveResponse> RemoveFromWatchlistByShowIdAsync(string showId, TraktTextShowIdType showIdType = TraktTextShowIdType.Auto, IEnumerable <int> seasonNumbers = null) { var obj = TraktShowFactory.FromId(showId, showIdType); if (seasonNumbers != null) { obj.Seasons = seasonNumbers.Select(s => new TraktSeason { SeasonNumber = s }).ToList(); } return(await RemoveFromWatchlistAsync(obj)); }
/// <summary>Add a show to the user's collection 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> AddToCollectionByShowIdAsync(string showId, TraktTextShowIdType showIdType = TraktTextShowIdType.Auto, IEnumerable <int> seasonNumbers = null) { var obj = TraktShowFactory.FromId <TraktShowWithCollectionMetadata>(showId, showIdType); if (seasonNumbers != null) { obj.Seasons = seasonNumbers.Select(s => new TraktSeasonWithCollectionMetadata { SeasonNumber = s }).ToList(); } return(await AddToCollectionAsync(obj)); }
/// <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 <string> showIds, TraktTextShowIdType showIdType = TraktTextShowIdType.Auto) where T : TraktShow { return(showIds == null ? null : showIds.Select(showId => FromId <T>(showId, showIdType))); }
/// <summary>Create an instance of <see cref="TraktShow"/> from an ID</summary> /// <param name="showId">The show ID</param> /// <param name="showIdType">The show ID type</param> /// <returns>See summary</returns> public static TraktShow FromId(string showId, TraktTextShowIdType showIdType = TraktTextShowIdType.Auto) { return(FromId <TraktShow>(showId, showIdType)); }