Ejemplo n.º 1
0
        public static TmdbPerson[] GetPopular(int minPage, int maxPage)
        {
            var l = Tmdb.CollapsePagedJson(
                Tmdb.InvokePaged("/person/popular", minPage, maxPage));

            return(JsonArray.ToArray(l, (d) => new TmdbPerson((IDictionary <string, object>)d)));
        }
Ejemplo n.º 2
0
        public static TmdbCompany[] SearchCompanies(string query, int minPage, int maxPage)
        {
            var args = new JsonObject();

            args.Add("query", query);
            return(JsonArray.ToArray(
                       Tmdb.CollapsePagedJson(
                           Tmdb.InvokePaged("/search/company", minPage, maxPage, args)),
                       (d) => new TmdbCompany((IDictionary <string, object>)d)));
        }
Ejemplo n.º 3
0
        public static TmdbPrimary[] GetTrending(TmdbTimeWindow window, int minPage = 0, int maxPage = 999)
        {
            string tw = "day";

            switch (window)
            {
            case TmdbTimeWindow.Week:
                tw = "week";
                break;
            }
            var l = Tmdb.CollapsePagedJson(
                Tmdb.InvokePaged(string.Concat("/trending/all/", tw), minPage, maxPage));

            return(JsonArray.ToArray(l, (d) => _GetPrimaryTrending((IDictionary <string, object>)d)));
        }
Ejemplo n.º 4
0
        public static TmdbMovie[] GetMovieChanges(DateTime startDate = default(DateTime), DateTime endDate = default(DateTime), int minPage = 0, int maxPage = 999)
        {
            var args = new JsonObject();

            if (default(DateTime) != startDate)
            {
                args.Add("start_date", startDate.ToString("yyyy-MM-dd"));
            }
            if (default(DateTime) != endDate)
            {
                args.Add("end_date", endDate.ToString("yyyy-MM-dd"));
            }
            return(JsonArray.ToArray(
                       Tmdb.CollapsePagedJson(
                           Tmdb.InvokePaged("/movie/changes", minPage, maxPage, args))
                       , (d) => new TmdbMovie(d as IDictionary <string, object>)));
        }