Esempio n. 1
0
        protected async Task <IEnumerable <TalkSummary> > CreateTalkSummaries(IEnumerable <Talk> talks)
        {
            return(await Task.WhenAll(talks.Select(CreateTalkSummary)));

            async Task <TalkSummary> CreateTalkSummary(Talk talk)
            {
                var url       = NavigateableController.GetTalkUrl(talk);
                var thumbnail = await thumbnailService.GetThumbnailUrl(talk);

                var conferenceName = conferences[talk.ConferenceId].Name;

                return(new TalkSummary(talk, url, thumbnail, conferenceName));
            }
        }
Esempio n. 2
0
        public async Task <ViewModels.TalkMetadata> GetTalkMetadata(Conference conference, string talkName)
        {
            var talk = await talkPersistence.GetTalkByName(conference, talkName);

            if (talk == null)
            {
                return(null);
            }

            var thumbnail = await thumbnailService.GetThumbnailUrl(talk);

            talk.Thumbnail = thumbnail;
            var editTalkViewModel = new EditTalkViewModel(talk);

            var availableVideos = new List <Video> {
                new Video(talk.VideoName)
            };
            var videosFromConference = await contentService.GetVideosFromConference(conference);

            availableVideos.AddRange(videosFromConference);
            var videoList = new SelectList(availableVideos, SelectListFieldName, SelectListFieldName, talk.VideoName);

            return(new ViewModels.TalkMetadata(editTalkViewModel, videoList));
        }