Esempio n. 1
0
        public void LoadFullCast()
        {
            WebClient wc      = new WebClient();
            string    jsonStr = wc.DownloadString(string.Format(Constants.CastEndpoint, Constants.ApiKey, Id));
            JObject   json    = JObject.Parse(jsonStr);

            FullCast = json["cast"].Select(x => CastMember.Parse(x)).ToList();
        }
Esempio n. 2
0
        internal static Movie Parse(JToken json, bool isAbbreviated = false)
        {
            Movie mov = new Movie();

            mov.Id                = json["id"].TryParseInt();
            mov.Title             = (string)json["title"];
            mov.Year              = json["year"].TryParseInt();
            mov.Genres            = isAbbreviated ? null : json["genres"].Select(x => (string)x).ToList();
            mov.MPAARating        = (string)json["mpaa_rating"];
            mov.Runtime           = json["runtime"].TryParseInt();
            mov.ReleaseDates      = ReleaseDates.Parse(json["release_dates"]);
            mov.Ratings           = Ratings.Parse(json["ratings"]);
            mov.Synopsis          = (string)json["synopsis"];
            mov.Posters           = Posters.Parse(json["posters"]);
            mov.AbridgedCast      = json["abridged_cast"].Select(x => CastMember.Parse(x)).ToList();
            mov.AbridgedDirectors = isAbbreviated ? null : json["abridged_directors"].Select(x => (string)x["name"]).ToList();
            mov.Links             = MovieLinks.Parse(json["links"]);
            mov.IsAbridged        = isAbbreviated;
            return(mov);
        }