diff --git a/appveyor.yml b/appveyor.yml index e06a927bf..683e76871 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,7 +4,7 @@ os: Visual Studio 2015 dotnet_csproj: patch: true file: '**\*.csproj' - version: '{version}' + version: '{version}-$(APPVEYOR_REPO_BRANCH)' package_version: '{version}' environment: diff --git a/src/Ombi.Helpers/ApplicationSettings.cs b/src/Ombi.Helpers/ApplicationSettings.cs index 5a17c421a..12be2087c 100644 --- a/src/Ombi.Helpers/ApplicationSettings.cs +++ b/src/Ombi.Helpers/ApplicationSettings.cs @@ -2,9 +2,6 @@ { public class ApplicationSettings { - public string Branch { get; set; } - public string Version { get; set; } public string OmbiService { get; set; } - public string FriendlyVersion { get; set; } } } \ No newline at end of file diff --git a/src/Ombi.Helpers/AssemblyHelper.cs b/src/Ombi.Helpers/AssemblyHelper.cs new file mode 100644 index 000000000..e7aba9b82 --- /dev/null +++ b/src/Ombi.Helpers/AssemblyHelper.cs @@ -0,0 +1,15 @@ +using System; +using System.Reflection; + +namespace Ombi.Helpers +{ + public static class AssemblyHelper + { + public static string GetRuntimeVersion() => + Assembly.GetEntryAssembly().GetType() + .GetTypeInfo() + .Assembly + .GetCustomAttribute() + .Product; + } +} \ No newline at end of file diff --git a/src/Ombi.Schedule/Jobs/Ombi/OmbiAutomaticUpdater.cs b/src/Ombi.Schedule/Jobs/Ombi/OmbiAutomaticUpdater.cs index f8c9b36ee..2bb9af10d 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/OmbiAutomaticUpdater.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/OmbiAutomaticUpdater.cs @@ -35,7 +35,8 @@ namespace Ombi.Schedule.Ombi // IF AutoUpdateEnabled => // ELSE Return; var currentLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); - var currentBranch = Settings.Branch; + //var currentBranch = Settings.Branch; + var currentBranch = "BRANCH"; #if DEBUG if (currentBranch == "{{BRANCH}}") @@ -45,7 +46,7 @@ namespace Ombi.Schedule.Ombi #endif var updates = await OmbiService.GetUpdates(currentBranch); var serverVersion = updates.UpdateVersionString.Substring(1, 6); - if (serverVersion != Settings.FriendlyVersion) + if (serverVersion != AssemblyHelper.GetRuntimeVersion()) { // Let's download the correct zip