#1460 The assembly versioning seems to work correctly now

pull/1510/head
Jamie.Rees 7 years ago
parent 2535645a90
commit 85303626f0

@ -36,6 +36,7 @@ using Ombi.Api.Service;
using Ombi.Api.Slack;
using Ombi.Core.Rule.Interfaces;
using Ombi.Core.Senders;
using Ombi.Schedule.Jobs.Ombi;
using Ombi.Schedule.Jobs.Plex;
using Ombi.Schedule.Ombi;
using Ombi.Store.Repository.Requests;

@ -9,7 +9,7 @@ namespace Ombi.Helpers
Assembly.GetEntryAssembly().GetType()
.GetTypeInfo()
.Assembly
.GetCustomAttribute<AssemblyProductAttribute>()
.Product;
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
.InformationalVersion;
}
}

@ -2,32 +2,31 @@
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net.Http;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Ombi.Api.Service;
using Ombi.Api.Service.Models;
using Ombi.Helpers;
using System.IO.Compression;
using Ombi.Schedule.Ombi;
namespace Ombi.Schedule.Ombi
namespace Ombi.Schedule.Jobs.Ombi
{
public class OmbiAutomaticUpdater : IOmbiAutomaticUpdater
{
public OmbiAutomaticUpdater(ILogger<OmbiAutomaticUpdater> log, IOmbiService service, IOptions<ApplicationSettings> settings)
public OmbiAutomaticUpdater(ILogger<OmbiAutomaticUpdater> log, IOmbiService service)
{
Logger = log;
OmbiService = service;
Settings = settings.Value;
}
private ILogger<OmbiAutomaticUpdater> Logger { get; }
private IOmbiService OmbiService { get; }
private ApplicationSettings Settings { get; }
public async Task Update()
{
@ -35,18 +34,17 @@ namespace Ombi.Schedule.Ombi
// IF AutoUpdateEnabled =>
// ELSE Return;
var currentLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
//var currentBranch = Settings.Branch;
var currentBranch = "BRANCH";
var productVersion = AssemblyHelper.GetRuntimeVersion();
#if DEBUG
if (currentBranch == "{{BRANCH}}")
{
currentBranch = "DotNetCore";
}
#endif
var updates = await OmbiService.GetUpdates(currentBranch);
var productArray = productVersion.Split('-');
var version = productArray[0];
var branch = productArray[1];
var updates = await OmbiService.GetUpdates(branch);
var serverVersion = updates.UpdateVersionString.Substring(1, 6);
if (serverVersion != AssemblyHelper.GetRuntimeVersion())
if (!serverVersion.Equals(version, StringComparison.CurrentCultureIgnoreCase))
{
// Let's download the correct zip

Loading…
Cancel
Save