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.Api.Slack;
|
||||||
using Ombi.Core.Rule.Interfaces;
|
using Ombi.Core.Rule.Interfaces;
|
||||||
using Ombi.Core.Senders;
|
using Ombi.Core.Senders;
|
||||||
|
using Ombi.Schedule.Jobs.Ombi;
|
||||||
using Ombi.Schedule.Jobs.Plex;
|
using Ombi.Schedule.Jobs.Plex;
|
||||||
using Ombi.Schedule.Ombi;
|
using Ombi.Schedule.Ombi;
|
||||||
using Ombi.Store.Repository.Requests;
|
using Ombi.Store.Repository.Requests;
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace Ombi.Helpers
|
||||||
Assembly.GetEntryAssembly().GetType()
|
Assembly.GetEntryAssembly().GetType()
|
||||||
.GetTypeInfo()
|
.GetTypeInfo()
|
||||||
.Assembly
|
.Assembly
|
||||||
.GetCustomAttribute<AssemblyProductAttribute>()
|
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
|
||||||
.Product;
|
.InformationalVersion;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,32 +2,31 @@
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
|
||||||
using Ombi.Api.Service;
|
using Ombi.Api.Service;
|
||||||
using Ombi.Api.Service.Models;
|
using Ombi.Api.Service.Models;
|
||||||
using Ombi.Helpers;
|
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 class OmbiAutomaticUpdater : IOmbiAutomaticUpdater
|
||||||
{
|
{
|
||||||
public OmbiAutomaticUpdater(ILogger<OmbiAutomaticUpdater> log, IOmbiService service, IOptions<ApplicationSettings> settings)
|
public OmbiAutomaticUpdater(ILogger<OmbiAutomaticUpdater> log, IOmbiService service)
|
||||||
{
|
{
|
||||||
Logger = log;
|
Logger = log;
|
||||||
OmbiService = service;
|
OmbiService = service;
|
||||||
Settings = settings.Value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ILogger<OmbiAutomaticUpdater> Logger { get; }
|
private ILogger<OmbiAutomaticUpdater> Logger { get; }
|
||||||
private IOmbiService OmbiService { get; }
|
private IOmbiService OmbiService { get; }
|
||||||
private ApplicationSettings Settings { get; }
|
|
||||||
|
|
||||||
public async Task Update()
|
public async Task Update()
|
||||||
{
|
{
|
||||||
|
@ -35,18 +34,17 @@ namespace Ombi.Schedule.Ombi
|
||||||
// IF AutoUpdateEnabled =>
|
// IF AutoUpdateEnabled =>
|
||||||
// ELSE Return;
|
// ELSE Return;
|
||||||
var currentLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
var currentLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||||
//var currentBranch = Settings.Branch;
|
|
||||||
var currentBranch = "BRANCH";
|
var productVersion = AssemblyHelper.GetRuntimeVersion();
|
||||||
|
|
||||||
#if DEBUG
|
var productArray = productVersion.Split('-');
|
||||||
if (currentBranch == "{{BRANCH}}")
|
var version = productArray[0];
|
||||||
{
|
var branch = productArray[1];
|
||||||
currentBranch = "DotNetCore";
|
|
||||||
}
|
|
||||||
#endif
|
var updates = await OmbiService.GetUpdates(branch);
|
||||||
var updates = await OmbiService.GetUpdates(currentBranch);
|
|
||||||
var serverVersion = updates.UpdateVersionString.Substring(1, 6);
|
var serverVersion = updates.UpdateVersionString.Substring(1, 6);
|
||||||
if (serverVersion != AssemblyHelper.GetRuntimeVersion())
|
if (!serverVersion.Equals(version, StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
|
|
||||||
// Let's download the correct zip
|
// Let's download the correct zip
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue