private MeetingDTO GetMeetingDTOByScoId(string scoId, AdobeConnectProvider provider) { var result = provider.GetScoInfo(scoId).ScoInfo; if (result == null) { return new MeetingDTO() { id = "0", connect_server = Credentials.ACDomain } } ; var permission = provider.GetScoPublicAccessPermissions(scoId).Values; return(this.GetMeetingDTOByScoInfo(result, permission)); }
void RunUmdRecordingsReport() { var container = new WindsorContainer(); WindsorIoC.Initialize(container); DIConfig.RegisterComponents(container); var logger = IoC.Resolve <ILogger>(); var accountService = new AdobeConnectAccountService(logger); // IAdobeConnectProxy ac = accountService.GetProvider(new AdobeConnectAccess("https://webmeeting.umd.edu/", "*****@*****.**", "e$ync123UMD"), true); var apiUrl = new Uri("https://webmeeting.umd.edu"); var connectionDetails = new ConnectionDetails(apiUrl); var provider = new AdobeConnectProvider(connectionDetails); LoginResult loginResult = provider.Login(new UserCredentials("*****@*****.**", "e$ync123UMD")); var recordings = provider.GetRecordingsList(null); //some id here // var recordingsWithoutCreate = recordings.Values.Where(x => x.DateCreated == default(DateTime)).ToList(); // var recordingsWithoutCreateWithEnd = recordingsWithoutCreate.Where(x => x.EndDate != default(DateTime)).ToList(); var recordingsWithoutEnd = recordings.Values.Where(x => x.EndDate == default(DateTime)).Select(x => x.ScoId); var result = recordings.Values.Where(x => recordingsWithoutEnd.All(r => r != x.ScoId) && x.ScoId != "2434849").ToList(); //2434849 - rec without start date, can't calculate duration double duration = 0; double biggestDuration = 0; string biggestRecSco = null; var recsAfter_20150601 = result.Where(x => x.DateCreated >= new DateTime(2015, 06, 01)); foreach (var rec in recsAfter_20150601) { var scoInfo = provider.GetScoInfo(rec.ScoId); var rec1 = provider.GetRecordingsList(scoInfo.ScoInfo.FolderId, rec.ScoId); TimeSpan ts; if (TimeSpan.TryParse(rec1.Values.First().Duration, out ts)) { duration += ts.TotalMinutes; if (ts.TotalMinutes > biggestDuration) { biggestDuration = ts.TotalMinutes; biggestRecSco = rec.ScoId; } } else { Console.WriteLine($"There was a problem with scoId={rec.ScoId} . Could not parse Duration={rec1.Values.First().Duration}"); } } Console.WriteLine($"Total recordings count after 2015/05/31 :{recsAfter_20150601.Count()}"); Console.WriteLine($"Total recordings duration(in minutes) after 2015/05/31 :{duration}"); Console.WriteLine($"The longest meeting duration(in minutes) after 2015/05/31 :{biggestDuration}, scoId={biggestRecSco}"); var recsBefore20150601 = result.Where(x => x.DateCreated < new DateTime(2015, 06, 01)); duration = 0; biggestDuration = 0; foreach (var rec in recsBefore20150601) { var scoInfo = provider.GetScoInfo(rec.ScoId); var rec1 = provider.GetRecordingsList(scoInfo.ScoInfo.FolderId, rec.ScoId); TimeSpan ts; if (TimeSpan.TryParse(rec1.Values.First().Duration, out ts)) { duration += ts.TotalMinutes; if (ts.TotalMinutes > biggestDuration) { biggestDuration = ts.TotalMinutes; biggestRecSco = rec.ScoId; } } else { Console.WriteLine($"There was a problem with scoId={rec.ScoId} . Could not parse Duration={rec1.Values.First().Duration}"); } } Console.WriteLine($"Total recordings count before 2015/05/31 :{recsBefore20150601.Count()}"); Console.WriteLine($"Total recordings duration(in minutes) before 2015/05/31 :{duration}"); Console.WriteLine($"The longest meeting duration(in minutes) before 2015/05/31 :{biggestDuration}, scoId={biggestRecSco}"); Console.ReadLine(); }