Esempio n. 1
0
        public static Uri GetUserProfileURI(string userKey)
        {
            UriBuilderWithQuerySupport u = new UriBuilderWithQuerySupport(RequestUriHelper.UserProfile.ToRequestUri(Base_URI, RESPONSE_TYPE));

            u.AddQueryParameter("user_key", userKey.CheckString(""), true);
            return(u.Uri);
        }
Esempio n. 2
0
        public static Uri GetMovieReviewURI(int movieID)
        {
            UriBuilderWithQuerySupport u = new UriBuilderWithQuerySupport(RequestUriHelper.MovieReview.ToRequestUri(Base_URI, RESPONSE_TYPE));

            u.AddQueryParameter("movie_id", movieID.ToString(), true);
            return(u.Uri);
        }
Esempio n. 3
0
        public static Uri GetMovieBookmarksURI(string userKey, bool rtRatings)
        {
            UriBuilderWithQuerySupport u = new UriBuilderWithQuerySupport(RequestUriHelper.MovieBookmarks.ToRequestUri(Base_URI, RESPONSE_TYPE));

            u.AddQueryParameter("user_key", userKey.CheckString(""), true);
            u.AddQueryParameter("with_rt_ratings", rtRatings.ToString().ToLowerInvariant(), true);
            return(u.Uri);
        }
Esempio n. 4
0
        public static Uri GetUserDetailsURI(int userID, bool withDownloads)
        {
            UriBuilderWithQuerySupport u = new UriBuilderWithQuerySupport(RequestUriHelper.UserDetails.ToRequestUri(Base_URI, RESPONSE_TYPE));

            u.AddQueryParameter("user_id", userID.ToString(), true);
            u.AddQueryParameter("with_recently_downloaded", withDownloads.ToString().ToLowerInvariant(), true);
            return(u.Uri);
        }
Esempio n. 5
0
        public static Uri CreateGetRequest(Uri uri, params KeyValuePair <string, string> [] queryParameters)
        {
            UriBuilderWithQuerySupport urib = new UriBuilderWithQuerySupport(uri);

            foreach (var i in queryParameters)
            {
                urib.AddQueryParameter(i.Key, i.Value, true);
            }
            return(urib.Uri);
        }
Esempio n. 6
0
        public static Uri GetMovieURI(int movieID,
                                      bool includeCast   = true,
                                      bool includeImages = true)
        {
            UriBuilderWithQuerySupport u = new UriBuilderWithQuerySupport(RequestUriHelper.MovieDetails.ToRequestUri(Base_URI, RESPONSE_TYPE));

            u.AddQueryParameter("movie_id", movieID.ToString(), true);
            u.AddQueryParameter("with_images", includeImages.ToString().ToLowerInvariant(), true);
            u.AddQueryParameter("with_cast", includeCast.ToString().ToLowerInvariant(), true);
            return(u.Uri);
        }
Esempio n. 7
0
        public static Uri GetListMovieURI(string queryTerm        = "",
                                          string quality          = "All",
                                          string genre            = "",
                                          uint minimumRating      = 0,
                                          uint limit              = 20,
                                          uint page               = 1,
                                          SearchResultSort sortBy = SearchResultSort.DateAdded,
                                          SortOrder orderBy       = SortOrder.Desc)
        {
            UriBuilderWithQuerySupport u = new UriBuilderWithQuerySupport(RequestUriHelper.ListMovies.ToRequestUri(Base_URI, RESPONSE_TYPE));

            u.AddQueryParameter("query_term", queryTerm.CheckString(""), true);
            u.AddQueryParameter("quality", quality.CheckString("All"), true);
            u.AddQueryParameter("genre", genre.CheckString(""), true);
            u.AddQueryParameter("minimum_rating", minimumRating.CheckMax(9, 0).ToString(), true);
            u.AddQueryParameter("limit", limit.CheckMax(50, 20).ToString(), true);
            u.AddQueryParameter("page", page.ToString(), true);
            u.AddQueryParameter("sort_by", sortBy.ToQueryParameterName(), true);
            u.AddQueryParameter("order_by", orderBy.ToString().ToLower(), true);

            return(u.Uri);
        }