Esempio n. 1
0
        public async Task <ActionResult> ViewBandProfile(int bandId)
        {
            Band band = GetBand(bandId);
            BandProfileViewModel model   = new BandProfileViewModel();
            SocialMediaIds       socials = GetBandSocials(band.socialId);

            model.band             = band;
            model.facebookImageUrl = await FacebookAPI.GetProfilePicture(socials.facebookPageId);

            model.facebookPermalinks = await FacebookAPI.GetPermaUrlFromPost(socials.facebookPageId);

            model.youtubeUrls = await GetYoutubeUrls(band);

            //model.facebookPermalinks = new List<string>(); // place holder for less API calls
            //model.youtubeUrls = new List<string>();

            model.reviews = GetBandReviews(band);
            model.score   = AverageReviews(model.reviews);
            model.gigs    = GetGigViewModel(GetGigs(band));



            return(View(model));
        }