Beispiel #1
0
        public string ExportNewBuilds(SirenOfShameSettings settings)
        {
            if (string.IsNullOrEmpty(settings.MyRawName))
            {
                return(null);
            }
            DateTime?highWaterMark       = settings.GetHighWaterMark();
            var      initialExport       = highWaterMark == null;
            var      allBuildDefinitions = ReadAll(settings.GetAllActiveBuildDefinitions());
            var      currentUsersBuilds  = allBuildDefinitions
                                           .Where(i => i.RequestedBy == settings.MyRawName)
                                           .Where(i => i.StartedTime != null);
            var buildsAfterHighWaterMark = initialExport ? currentUsersBuilds : currentUsersBuilds.Where(i => i.StartedTime > highWaterMark);
            var buildsAsExport           = buildsAfterHighWaterMark.Select(i => i.AsSosOnlineExport());
            var result = string.Join("\r\n", buildsAsExport);

            return(string.IsNullOrEmpty(result) ? null : result);
        }