mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-15 01:32:55 -07:00
#1460 The assembly versioning seems to work correctly now
This commit is contained in:
parent
2535645a90
commit
85303626f0
3 changed files with 17 additions and 18 deletions
|
@ -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";
|
||||
|
||||
#if DEBUG
|
||||
if (currentBranch == "{{BRANCH}}")
|
||||
{
|
||||
currentBranch = "DotNetCore";
|
||||
}
|
||||
#endif
|
||||
var updates = await OmbiService.GetUpdates(currentBranch);
|
||||
var productVersion = AssemblyHelper.GetRuntimeVersion();
|
||||
|
||||
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…
Add table
Add a link
Reference in a new issue