Ejemplo n.º 1
0
        public override IDictionary <string, object> GetUriPathParameters()
        {
            var uriParams = new Dictionary <string, object>();

            if (ExtendedInfo != null && ExtendedInfo.HasAnySet)
            {
                uriParams.Add("extended", ExtendedInfo.ToString());
            }

            if (Filter != null && Filter.HasValues)
            {
                var filterParameters = Filter.GetParameters();

                foreach (var param in filterParameters)
                {
                    uriParams.Add(param.Key, param.Value);
                }
            }

            if (Page.HasValue)
            {
                uriParams.Add("page", Page.Value.ToString());
            }

            if (Limit.HasValue)
            {
                uriParams.Add("limit", Limit.Value.ToString());
            }

            return(uriParams);
        }
        public override IDictionary <string, object> GetUriPathParameters()
        {
            var uriParams = base.GetUriPathParameters();

            if (Type != null && Type != TraktRecommendationObjectType.Unspecified)
            {
                uriParams.Add("type", Type.UriName);

                if (Sort != null && Sort != TraktWatchlistSortOrder.Unspecified)
                {
                    uriParams.Add("sort", Sort.UriName);
                }
            }

            if (ExtendedInfo != null && ExtendedInfo.HasAnySet)
            {
                uriParams.Add("extended", ExtendedInfo.ToString());
            }

            if (Page.HasValue)
            {
                uriParams.Add("page", Page.Value.ToString());
            }

            if (Limit.HasValue)
            {
                uriParams.Add("limit", Limit.Value.ToString());
            }

            return(uriParams);
        }
Ejemplo n.º 3
0
        public override IDictionary <string, object> GetUriPathParameters()
        {
            var uriParams = new Dictionary <string, object>();

            if (StartDate.HasValue)
            {
                uriParams.Add("start_date", StartDate.Value.ToTraktDateString());
            }

            if (ExtendedInfo != null && ExtendedInfo.HasAnySet)
            {
                uriParams.Add("extended", ExtendedInfo.ToString());
            }

            if (Page.HasValue)
            {
                uriParams.Add("page", Page.Value.ToString());
            }

            if (Limit.HasValue)
            {
                uriParams.Add("limit", Limit.Value.ToString());
            }

            return(uriParams);
        }
Ejemplo n.º 4
0
        public override IDictionary <string, object> GetUriPathParameters()
        {
            var uriParams = new Dictionary <string, object>();

            if (Type != null && Type != TraktSyncItemType.Unspecified)
            {
                uriParams.Add("type", Type.UriName);
            }

            if (ExtendedInfo != null && ExtendedInfo.HasAnySet)
            {
                uriParams.Add("extended", ExtendedInfo.ToString());
            }

            if (Page.HasValue)
            {
                uriParams.Add("page", Page.Value.ToString());
            }

            if (Limit.HasValue)
            {
                uriParams.Add("limit", Limit.Value.ToString());
            }

            return(uriParams);
        }
        public override IDictionary <string, object> GetUriPathParameters()
        {
            var uriParams = new Dictionary <string, object>();

            var isTypeSetAndValid = Type != null && Type != TraktSyncItemType.Unspecified;

            if (isTypeSetAndValid)
            {
                uriParams.Add("type", Type.UriName);
            }

            if (isTypeSetAndValid && ItemId.HasValue && ItemId.Value > 0)
            {
                uriParams.Add("item_id", ItemId.ToString());
            }

            if (StartAt.HasValue)
            {
                uriParams.Add("start_at", StartAt.Value.ToTraktLongDateTimeString());
            }

            if (EndAt.HasValue)
            {
                uriParams.Add("end_at", EndAt.Value.ToTraktLongDateTimeString());
            }

            if (ExtendedInfo != null && ExtendedInfo.HasAnySet)
            {
                uriParams.Add("extended", ExtendedInfo.ToString());
            }

            if (Page.HasValue)
            {
                uriParams.Add("page", Page.Value.ToString());
            }

            if (Limit.HasValue)
            {
                uriParams.Add("limit", Limit.Value.ToString());
            }

            return(uriParams);
        }
        public override IDictionary <string, object> GetUriPathParameters()
        {
            var uriParams = new Dictionary <string, object>();

            var isTypeSetAndValid = Type != null && Type != TraktRatingsItemType.Unspecified;

            if (isTypeSetAndValid)
            {
                uriParams.Add("type", Type.UriName);
            }

            if (RatingFilter != null && isTypeSetAndValid)
            {
                var ratingsMin = RatingFilter.Min();
                var ratingsMax = RatingFilter.Max();

                var isRatingsSetAndValid = RatingFilter.Length > 0 && RatingFilter.Length <= 10 && ratingsMin >= 1 && ratingsMax <= 10;

                if (isRatingsSetAndValid)
                {
                    uriParams.Add("rating", string.Join(",", RatingFilter));
                }
            }

            if (ExtendedInfo != null && ExtendedInfo.HasAnySet)
            {
                uriParams.Add("extended", ExtendedInfo.ToString());
            }

            if (Page.HasValue)
            {
                uriParams.Add("page", Page.Value.ToString());
            }

            if (Limit.HasValue)
            {
                uriParams.Add("limit", Limit.Value.ToString());
            }

            return(uriParams);
        }
        public override IDictionary <string, object> GetUriPathParameters()
        {
            var uriParams = new Dictionary <string, object>();

            if (ExtendedInfo != null && ExtendedInfo.HasAnySet)
            {
                uriParams.Add("extended", ExtendedInfo.ToString());
            }

            if (Limit.HasValue)
            {
                uriParams.Add("limit", Limit.Value.ToString());
            }

            if (IgnoreCollected.HasValue)
            {
                uriParams.Add("ignore_collected", IgnoreCollected.Value.ToString().ToLower());
            }

            return(uriParams);
        }
Ejemplo n.º 8
0
        public override IDictionary <string, object> GetUriPathParameters()
        {
            var uriParams = new Dictionary <string, object>();

            if (StartDate.HasValue)
            {
                uriParams.Add("start_date", StartDate.Value.ToTraktDateString());
            }

            if (Days.HasValue)
            {
                uriParams.Add("days", Days.Value.ToString());

                if (!StartDate.HasValue)
                {
                    uriParams.Add("start_date", DateTime.UtcNow.ToTraktDateString());
                }
            }

            if (ExtendedInfo?.HasAnySet == true)
            {
                uriParams.Add("extended", ExtendedInfo.ToString());
            }

            if (Filter?.HasValues == true)
            {
                var filterParameters = Filter.GetParameters();

                foreach (var param in filterParameters)
                {
                    uriParams.Add(param.Key, param.Value);
                }
            }

            return(uriParams);
        }
Ejemplo n.º 9
0
        public override IDictionary <string, object> GetUriPathParameters()
        {
            var uriParams = new Dictionary <string, object>();

            if (CommentType != null && CommentType != TraktCommentType.Unspecified)
            {
                uriParams.Add("comment_type", CommentType.UriName);
            }

            if (ObjectType != null && ObjectType != TraktObjectType.Unspecified)
            {
                uriParams.Add("object_type", ObjectType.UriName);
            }

            if (IncludeReplies.HasValue)
            {
                uriParams.Add("include_replies", IncludeReplies.ToString().ToLower());
            }

            if (ExtendedInfo != null && ExtendedInfo.HasAnySet)
            {
                uriParams.Add("extended", ExtendedInfo.ToString());
            }

            if (Page.HasValue)
            {
                uriParams.Add("page", Page.Value.ToString());
            }

            if (Limit.HasValue)
            {
                uriParams.Add("limit", Limit.Value.ToString());
            }

            return(uriParams);
        }