diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-22 10:43:01 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-22 10:43:01 +0200 |
| commit | 30d1e5ac11cb30d3ad4e3501d795f780f55b3686 (patch) | |
| tree | 68eff5dbcbe0e0b52d1d74318c613ee09e462ae8 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs | |
| parent | b7962172b35452ba226cbc7d9bb5fc9afdbd5ecb (diff) | |
| download | Tango-30d1e5ac11cb30d3ad4e3501d795f780f55b3686.tar.gz Tango-30d1e5ac11cb30d3ad4e3501d795f780f55b3686.zip | |
Fixed issue with machine studio update service not reporting new updates.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs index ce9f7bd93..2453fd361 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs @@ -68,35 +68,34 @@ namespace Tango.MachineStudio.UpdateService { var versions = db.MachineStudioVersions.ToList(); - var latestVersion = versions.OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault(); - Version currentVersion = Version.Parse(request.Version); - - bool isForcedUpdate = versions.Exists(x => x.ForceUpdate && Version.Parse(x.Version) > currentVersion); - - bool stable_condition = true; + MachineStudioVersion latestVersion = null; - if (!request.AcceptBetaRelease && !latestVersion.Stable) + if (request.AcceptBetaRelease) { - stable_condition = false; + latestVersion = versions.OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault(); } + else + { + latestVersion = versions.Where(x => x.Stable).OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault(); + } + + Version currentVersion = Version.Parse(request.Version); + + bool isForcedUpdate = versions.Exists(x => x.ForceUpdate && Version.Parse(x.Version) > currentVersion); String comments = String.Join(Environment.NewLine, versions.OrderBy(x => Version.Parse(x.Version)).Where(x => Version.Parse(x.Version) > currentVersion).Select(x => x.Comments)); if (latestVersion != null && Version.Parse(latestVersion.Version) > currentVersion) { - if (stable_condition) - { - response.IsUpdateAvailable = true; - - response.FtpHost = ConfigurationManager.AppSettings["FtpHost"].ToString(); - response.UserName = ConfigurationManager.AppSettings["UserName"].ToString(); - response.Password = ConfigurationManager.AppSettings["Password"].ToString(); - response.FilePath = latestVersion.FtpFilePath; - response.Version = latestVersion.Version; - response.Comments = latestVersion.Comments; - response.ForcedUpdate = isForcedUpdate; - response.IsStable = latestVersion.Stable; - } + response.IsUpdateAvailable = true; + response.FtpHost = ConfigurationManager.AppSettings["FtpHost"].ToString(); + response.UserName = ConfigurationManager.AppSettings["UserName"].ToString(); + response.Password = ConfigurationManager.AppSettings["Password"].ToString(); + response.FilePath = latestVersion.FtpFilePath; + response.Version = latestVersion.Version; + response.Comments = latestVersion.Comments; + response.ForcedUpdate = isForcedUpdate; + response.IsStable = latestVersion.Stable; } } else |
