Some final tweaks for #32

This commit is contained in:
tidusjar 2016-04-05 22:23:01 +01:00
parent 5e5fe1f395
commit f3cca9f0e9
3 changed files with 48 additions and 30 deletions

View file

@ -26,8 +26,6 @@
#endregion
using System;
using System.Linq;
using System.Reflection;
using System.Runtime.Versioning;
using System.Threading.Tasks;
using Octokit;
@ -62,7 +60,10 @@ namespace PlexRequests.Core
};
var latestRelease = GetLatestRelease();
if (latestRelease.Result == null)
{
return new StatusModel { Version = "Unknown" };
}
var latestVersionArray = latestRelease.Result.Name.Split(new[] { 'v' }, StringSplitOptions.RemoveEmptyEntries);
var latestVersion = latestVersionArray.Length > 1 ? latestVersionArray[1] : string.Empty;