From 863df6e1cccb76606c949be2484f9214c27f6b4f Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Thu, 27 Jul 2017 08:13:43 +0100 Subject: [PATCH] Some work around the Auto Updater and other small changes #1460 #865 --- BuildTask.ps1 | 1 + appveyor.yml | 10 +- src/Ombi.Api.Service/IOmbiService.cs | 10 ++ src/Ombi.Api.Service/Models/Updates.cs | 47 +++++++ src/Ombi.Api.Service/Ombi.Api.Service.csproj | 18 +++ src/Ombi.Api.Service/OmbiService.cs | 33 +++++ src/Ombi.Core/Engine/MovieRequestEngine.cs | 2 +- src/Ombi.DependencyInjection/IocExtensions.cs | 4 + .../Ombi.DependencyInjection.csproj | 1 + src/Ombi.Helpers/ApplicationSettings.cs | 10 ++ src/Ombi.Helpers/LoggingEvents.cs | 3 + src/Ombi.Helpers/StringHelper.cs | 4 + src/Ombi.Schedule/JobSetup.cs | 7 +- src/Ombi.Schedule/{ => Jobs}/IJobSetup.cs | 0 .../Jobs/Ombi/OmbiAutomaticUpdater.cs | 132 ++++++++++++++++++ src/Ombi.Schedule/Ombi.Schedule.csproj | 2 + .../Ombi/Jobs/IOmbiAutomaticUpdater.cs | 9 ++ src/Ombi.Updater/Installer.cs | 1 - src/Ombi.Updater/Program.cs | 2 +- src/Ombi.sln | 11 +- .../app/search/tvsearch.component.ts | 2 +- .../ClientApp/app/services/search.service.ts | 2 +- src/Ombi/Config/ApplicationSettings.cs | 7 - src/Ombi/Controllers/SearchController.cs | 2 +- src/Ombi/Startup.cs | 1 + src/Ombi/appsettings.json | 5 +- 26 files changed, 303 insertions(+), 23 deletions(-) create mode 100644 src/Ombi.Api.Service/IOmbiService.cs create mode 100644 src/Ombi.Api.Service/Models/Updates.cs create mode 100644 src/Ombi.Api.Service/Ombi.Api.Service.csproj create mode 100644 src/Ombi.Api.Service/OmbiService.cs create mode 100644 src/Ombi.Helpers/ApplicationSettings.cs rename src/Ombi.Schedule/{ => Jobs}/IJobSetup.cs (100%) create mode 100644 src/Ombi.Schedule/Jobs/Ombi/OmbiAutomaticUpdater.cs create mode 100644 src/Ombi.Schedule/Ombi/Jobs/IOmbiAutomaticUpdater.cs delete mode 100644 src/Ombi/Config/ApplicationSettings.cs diff --git a/BuildTask.ps1 b/BuildTask.ps1 index e3c3a38c0..9ed055206 100644 --- a/BuildTask.ps1 +++ b/BuildTask.ps1 @@ -8,4 +8,5 @@ param([String]$env='local') $appSettingsPath = $env:APPVEYOR_BUILD_FOLDER + '\src\Ombi\appsettings.json' $appSettings = Get-Content $appSettingsPath -raw $appSettings = $appSettings.Replace("{{VERSIONNUMBER}}",$env:APPVEYOR_BUILD_VERSION); +$appSettings = $appSettings.Replace("{{BRANCH}}",$env:APPVEYOR_REPO_BRANCH); Set-Content -Path $appSettingsPath -Value $appSettings diff --git a/appveyor.yml b/appveyor.yml index ec1b5a351..f6a99fceb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -34,15 +34,15 @@ after_build: - dotnet publish "../Ombi.Updater" -c Release -r centos.7-x64 # Copy over the updater files so we can include them in the .zip - copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\win10-x64\publish\Ombi.Updater.dll" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\win10-x64\publish\Ombi.Updater.dll" -- copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\win10-x64\publish\Ombi.Updater.dll" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\win10-x64\publish\Ombi.Updater.exe" +- copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\win10-x64\publish\Ombi.Updater.exe" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\win10-x64\publish\Ombi.Updater.exe" - copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\osx.10.12-x64\publish\Ombi.Updater.dll" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\osx.10.12-x64\publish\Ombi.Updater.dll" -- copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\osx.10.12-x64\publish\Ombi.Updater.dll" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\osx.10.12-x64\publish\Ombi.Updater.exe" +- copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\osx.10.12-x64\publish\Ombi.Updater" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\osx.10.12-x64\publish\Ombi.Updater" - copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\ubuntu.16.10-x64\publish\Ombi.Updater.dll" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\ubuntu.16.10-x64\publish\Ombi.Updater.dll" -- copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\ubuntu.16.10-x64\publish\Ombi.Updater.dll" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\ubuntu.16.10-x64\publish\Ombi.Updater.exe" +- copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\ubuntu.16.10-x64\publish\Ombi.Updater" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\ubuntu.16.10-x64\publish\Ombi.Updater" - copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\debian.8-x64\publish\Ombi.Updater.dll" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\debian.8-x64\publish\Ombi.Updater.dll" -- copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\debian.8-x64\publish\Ombi.Updater.dll" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\debian.8-x64\publish\Ombi.Updater.exe" +- copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\debian.8-x64\publish\Ombi.Updater" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\debian.8-x64\publish\Ombi.Updater" - copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\centos.7-x64\publish\Ombi.Updater.dll" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\centos.7-x64\publish\Ombi.Updater.dll" -- copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\centos.7-x64\publish\Ombi.Updater.dll" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\centos.7-x64\publish\Ombi.Updater.exe" +- copy "%APPVEYOR_BUILD_FOLDER%\src\Ombi.Updater\bin\release\netcoreapp1.1\centos.7-x64\publish\Ombi.Updater" "%APPVEYOR_BUILD_FOLDER%\src\Ombi\bin\Release\netcoreapp1.1\centos.7-x64\publish\Ombi.Updater" #Copy the swagger files diff --git a/src/Ombi.Api.Service/IOmbiService.cs b/src/Ombi.Api.Service/IOmbiService.cs new file mode 100644 index 000000000..0ba4dc9c4 --- /dev/null +++ b/src/Ombi.Api.Service/IOmbiService.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; +using Ombi.Api.Service.Models; + +namespace Ombi.Api.Service +{ + public interface IOmbiService + { + Task GetUpdates(string branch); + } +} \ No newline at end of file diff --git a/src/Ombi.Api.Service/Models/Updates.cs b/src/Ombi.Api.Service/Models/Updates.cs new file mode 100644 index 000000000..3a853064f --- /dev/null +++ b/src/Ombi.Api.Service/Models/Updates.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Ombi.Api.Service.Models +{ + + public class Updates + { + [JsonProperty("id")] + public int Id { get; set; } + [JsonProperty("updateVersionString")] + public string UpdateVersionString { get; set; } + [JsonProperty("updateVersion")] + public int UpdateVersion { get; set; } + [JsonProperty("updateDate")] + public DateTime UpdateDate { get; set; } + [JsonProperty("changeLogs")] + public List ChangeLogs { get; set; } + [JsonProperty("downloads")] + public List Downloads { get; set; } + } + + public class Changelog + { + [JsonProperty("id")] + public int Id { get; set; } + [JsonProperty("type")] + public string Type { get; set; } + [JsonProperty("descripion")] + public string Descripion { get; set; } + [JsonProperty("updateId")] + public int UpdateId { get; set; } + } + + public class Download + { + [JsonProperty("id")] + public int Id { get; set; } + [JsonProperty("name")] + public string Name { get; set; } + [JsonProperty("url")] + public string Url { get; set; } + [JsonProperty("updateId")] + public int UpdateId { get; set; } + } +} \ No newline at end of file diff --git a/src/Ombi.Api.Service/Ombi.Api.Service.csproj b/src/Ombi.Api.Service/Ombi.Api.Service.csproj new file mode 100644 index 000000000..8f5104a0b --- /dev/null +++ b/src/Ombi.Api.Service/Ombi.Api.Service.csproj @@ -0,0 +1,18 @@ + + + + netstandard1.6 + Ombi.Api.Service + Ombi.Api.Service + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Ombi.Api.Service/OmbiService.cs b/src/Ombi.Api.Service/OmbiService.cs new file mode 100644 index 000000000..c4a059e78 --- /dev/null +++ b/src/Ombi.Api.Service/OmbiService.cs @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using Ombi.Api.Service.Models; +using Ombi.Helpers; + +namespace Ombi.Api.Service +{ + public class OmbiService : IOmbiService + { + public OmbiService(IOptions settings, IApi api, ILogger log) + { + Settings = settings.Value; + Api = api; + Logger = log; + } + + private ApplicationSettings Settings { get; } + private ILogger Logger { get; } + private IApi Api { get; } + + public async Task GetUpdates(string branch) + { + var request = new Request($"api/update/{branch}", Settings.OmbiService, HttpMethod.Get); + + request.ContentHeaders.Add(new KeyValuePair("Content-Type", "application/json")); + + return await Api.Request(request); + } + } +} diff --git a/src/Ombi.Core/Engine/MovieRequestEngine.cs b/src/Ombi.Core/Engine/MovieRequestEngine.cs index 84637a97a..b03a88d6f 100644 --- a/src/Ombi.Core/Engine/MovieRequestEngine.cs +++ b/src/Ombi.Core/Engine/MovieRequestEngine.cs @@ -45,7 +45,7 @@ namespace Ombi.Core.Engine public async Task RequestMovie(SearchMovieViewModel model) { var movieInfo = await MovieApi.GetMovieInformation(model.Id); - if (movieInfo == null) + if (movieInfo == null || movieInfo.Id == 0) { return new RequestEngineResult { diff --git a/src/Ombi.DependencyInjection/IocExtensions.cs b/src/Ombi.DependencyInjection/IocExtensions.cs index a9c36dec7..589e21373 100644 --- a/src/Ombi.DependencyInjection/IocExtensions.cs +++ b/src/Ombi.DependencyInjection/IocExtensions.cs @@ -28,7 +28,9 @@ using Ombi.Store.Repository; using Ombi.Notifications.Agents; using Ombi.Schedule.Jobs.Radarr; using Ombi.Api; +using Ombi.Api.Service; using Ombi.Core.Rule.Interfaces; +using Ombi.Schedule.Ombi; using Ombi.Store.Repository.Requests; namespace Ombi.DependencyInjection @@ -68,6 +70,7 @@ namespace Ombi.DependencyInjection services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); } public static void RegisterStore(this IServiceCollection services) @@ -103,6 +106,7 @@ namespace Ombi.DependencyInjection services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); } public static void RegisterIdentity(this IServiceCollection services) diff --git a/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj b/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj index fe4befec3..1c26342a6 100644 --- a/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj +++ b/src/Ombi.DependencyInjection/Ombi.DependencyInjection.csproj @@ -15,6 +15,7 @@ + diff --git a/src/Ombi.Helpers/ApplicationSettings.cs b/src/Ombi.Helpers/ApplicationSettings.cs new file mode 100644 index 000000000..5a17c421a --- /dev/null +++ b/src/Ombi.Helpers/ApplicationSettings.cs @@ -0,0 +1,10 @@ +namespace Ombi.Helpers +{ + 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/LoggingEvents.cs b/src/Ombi.Helpers/LoggingEvents.cs index 9c694a2cf..85fa25b31 100644 --- a/src/Ombi.Helpers/LoggingEvents.cs +++ b/src/Ombi.Helpers/LoggingEvents.cs @@ -18,5 +18,8 @@ namespace Ombi.Helpers public static EventId TvSender => new EventId(5000); public static EventId SonarrSender => new EventId(5001); + + public static EventId Updater => new EventId(6000); + } } \ No newline at end of file diff --git a/src/Ombi.Helpers/StringHelper.cs b/src/Ombi.Helpers/StringHelper.cs index 4c76df85d..fdb1dea84 100644 --- a/src/Ombi.Helpers/StringHelper.cs +++ b/src/Ombi.Helpers/StringHelper.cs @@ -9,6 +9,10 @@ namespace Ombi.Helpers { public static bool Contains(this string paragraph, string word, CompareOptions opts) { + if (string.IsNullOrEmpty(paragraph)) + { + return false; + } return CultureInfo.CurrentUICulture.CompareInfo.IndexOf(paragraph, word, CompareOptions.IgnoreCase) >= 0; } diff --git a/src/Ombi.Schedule/JobSetup.cs b/src/Ombi.Schedule/JobSetup.cs index 10c27a30d..a4f05795b 100644 --- a/src/Ombi.Schedule/JobSetup.cs +++ b/src/Ombi.Schedule/JobSetup.cs @@ -1,24 +1,27 @@ using Hangfire; using Ombi.Schedule.Jobs; using Ombi.Schedule.Jobs.Radarr; +using Ombi.Schedule.Ombi; namespace Ombi.Schedule { public class JobSetup : IJobSetup { - public JobSetup(IPlexContentCacher cacher, IRadarrCacher radarrCacher) + public JobSetup(IPlexContentCacher cacher, IRadarrCacher radarrCacher, IOmbiAutomaticUpdater updater) { Cacher = cacher; RadarrCacher = radarrCacher; + Updater = updater; } private IPlexContentCacher Cacher { get; } private IRadarrCacher RadarrCacher { get; } - + private IOmbiAutomaticUpdater Updater { get; } public void Setup() { RecurringJob.AddOrUpdate(() => Cacher.CacheContent(), Cron.Hourly); RecurringJob.AddOrUpdate(() => RadarrCacher.CacheContent(), Cron.Hourly); + RecurringJob.AddOrUpdate(() => Updater.Update(), Cron.Minutely); } } } diff --git a/src/Ombi.Schedule/IJobSetup.cs b/src/Ombi.Schedule/Jobs/IJobSetup.cs similarity index 100% rename from src/Ombi.Schedule/IJobSetup.cs rename to src/Ombi.Schedule/Jobs/IJobSetup.cs diff --git a/src/Ombi.Schedule/Jobs/Ombi/OmbiAutomaticUpdater.cs b/src/Ombi.Schedule/Jobs/Ombi/OmbiAutomaticUpdater.cs new file mode 100644 index 000000000..d7a0bfba2 --- /dev/null +++ b/src/Ombi.Schedule/Jobs/Ombi/OmbiAutomaticUpdater.cs @@ -0,0 +1,132 @@ +using System; +using System.Diagnostics; +using System.Globalization; +using System.IO; +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; + +namespace Ombi.Schedule.Ombi +{ + public class OmbiAutomaticUpdater : IOmbiAutomaticUpdater + { + public OmbiAutomaticUpdater(ILogger log, IOmbiService service, IOptions settings) + { + Logger = log; + OmbiService = service; + Settings = settings.Value; + } + + private ILogger Logger { get; } + private IOmbiService OmbiService { get; } + private ApplicationSettings Settings { get; } + + public async Task Update() + { + + // IF AutoUpdateEnabled => + // ELSE Return; + var currentLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); + var currentBranch = Settings.Branch; + +#if DEBUG + if (currentBranch == "{{BRANCH}}") + { + currentBranch = "DotNetCore"; + } +#endif + var updates = await OmbiService.GetUpdates(currentBranch); + var serverVersion = updates.UpdateVersionString.Substring(1, 6); + if (serverVersion != Settings.FriendlyVersion) + { + + // Let's download the correct zip + var desc = RuntimeInformation.OSDescription; + var proce = RuntimeInformation.ProcessArchitecture; + + Logger.LogInformation(LoggingEvents.Updater, "OS Information: {0} {1}", desc, proce); + Download download; + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + Logger.LogInformation(LoggingEvents.Updater, "We are Windows"); + download = updates.Downloads.FirstOrDefault(x => x.Name.Contains("windows", CompareOptions.IgnoreCase)); + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + Logger.LogInformation(LoggingEvents.Updater, "We are OSX"); + download = updates.Downloads.FirstOrDefault(x => x.Name.Contains("osx", CompareOptions.IgnoreCase)); + + } + else + { + // Linux + if (desc.Contains("ubuntu", CompareOptions.IgnoreCase)) + { + // Ubuntu + Logger.LogInformation(LoggingEvents.Updater, "We are ubuntu"); + download = updates.Downloads.FirstOrDefault(x => x.Name.Contains("ubuntu", CompareOptions.IgnoreCase)); + + } + else if (desc.Contains("debian", CompareOptions.IgnoreCase)) + { + // Debian + Logger.LogInformation(LoggingEvents.Updater, "We are debian"); + download = updates.Downloads.FirstOrDefault(x => x.Name.Contains("debian", CompareOptions.IgnoreCase)); + } + else if (desc.Contains("centos", CompareOptions.IgnoreCase)) + { + // Centos + Logger.LogInformation(LoggingEvents.Updater, "We are centos"); + download = updates.Downloads.FirstOrDefault(x => x.Name.Contains("centos", + CompareOptions.IgnoreCase)); + } + else + { + return; + } + } + + // Download it + await DownloadAsync(download.Url, Path.Combine(currentLocation, "Ombi.zip")); + + + // There must be an update + //var start = new ProcessStartInfo + //{ + // UseShellExecute = false, + // CreateNoWindow = true, + // FileName = "Ombi.Updater.exe", + // Arguments = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + //}; + //using (var proc = new Process { StartInfo = start }) + //{ + // proc.Start(); + //} + + } + else + { + // No updates + return; + } + } + + public static async Task DownloadAsync(string requestUri, string filename) + { + using (var client = new HttpClient()) + using (var request = new HttpRequestMessage(HttpMethod.Get, requestUri)) + using (Stream contentStream = await (await client.SendAsync(request)).Content.ReadAsStreamAsync(), + stream = new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.None, 3145728, true)) + { + await contentStream.CopyToAsync(stream); + } + } + } +} \ No newline at end of file diff --git a/src/Ombi.Schedule/Ombi.Schedule.csproj b/src/Ombi.Schedule/Ombi.Schedule.csproj index 9756a2525..b50e67ed5 100644 --- a/src/Ombi.Schedule/Ombi.Schedule.csproj +++ b/src/Ombi.Schedule/Ombi.Schedule.csproj @@ -10,12 +10,14 @@ + + diff --git a/src/Ombi.Schedule/Ombi/Jobs/IOmbiAutomaticUpdater.cs b/src/Ombi.Schedule/Ombi/Jobs/IOmbiAutomaticUpdater.cs new file mode 100644 index 000000000..c6c94d03d --- /dev/null +++ b/src/Ombi.Schedule/Ombi/Jobs/IOmbiAutomaticUpdater.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; + +namespace Ombi.Schedule.Ombi +{ + public interface IOmbiAutomaticUpdater + { + Task Update(); + } +} \ No newline at end of file diff --git a/src/Ombi.Updater/Installer.cs b/src/Ombi.Updater/Installer.cs index 47c114c10..f31ebb110 100644 --- a/src/Ombi.Updater/Installer.cs +++ b/src/Ombi.Updater/Installer.cs @@ -13,7 +13,6 @@ namespace Ombi.Updater { // Kill Ombi Process var p = new ProcessProvider(); - p.Kill(options.OmbiProcessId); diff --git a/src/Ombi.Updater/Program.cs b/src/Ombi.Updater/Program.cs index f361c69ef..f74dafa0d 100644 --- a/src/Ombi.Updater/Program.cs +++ b/src/Ombi.Updater/Program.cs @@ -9,7 +9,7 @@ namespace Ombi.Updater static void Main(string[] args) { Console.WriteLine("======================================="); - Console.WriteLine(" Starting the Ombi Updater"); + Console.WriteLine(" Starting the Ombi Updater" ); Console.WriteLine("======================================="); diff --git a/src/Ombi.sln b/src/Ombi.sln index 6d46fa167..2e138e3a6 100644 --- a/src/Ombi.sln +++ b/src/Ombi.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26430.14 +VisualStudioVersion = 15.0.26430.16 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi", "Ombi\Ombi.csproj", "{C987AA67-AFE1-468F-ACD3-EAD5A48E1F6A}" EndProject @@ -65,7 +65,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Updater", "Ombi.Update EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Update", "Update", "{D11FE57E-1E57-491D-A1D4-01AEF4BE5CB6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ombi.Notifications.Tests", "Ombi.Notifications.Tests\Ombi.Notifications.Tests.csproj", "{2C7836E7-B120-40A6-B641-DDAA02FBAE23}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Notifications.Tests", "Ombi.Notifications.Tests\Ombi.Notifications.Tests.csproj", "{2C7836E7-B120-40A6-B641-DDAA02FBAE23}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Service", "Ombi.Api.Service\Ombi.Api.Service.csproj", "{A0892896-F5BD-47E2-823E-DFCE82514EEC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -161,6 +163,10 @@ Global {2C7836E7-B120-40A6-B641-DDAA02FBAE23}.Debug|Any CPU.Build.0 = Debug|Any CPU {2C7836E7-B120-40A6-B641-DDAA02FBAE23}.Release|Any CPU.ActiveCfg = Release|Any CPU {2C7836E7-B120-40A6-B641-DDAA02FBAE23}.Release|Any CPU.Build.0 = Release|Any CPU + {A0892896-F5BD-47E2-823E-DFCE82514EEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0892896-F5BD-47E2-823E-DFCE82514EEC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0892896-F5BD-47E2-823E-DFCE82514EEC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0892896-F5BD-47E2-823E-DFCE82514EEC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -182,5 +188,6 @@ Global {5AF2B6D2-5CC6-49FE-928A-BA27AF52B194} = {9293CA11-360A-4C20-A674-B9E794431BF5} {6294A82D-4915-4FC3-B301-8F985716F34C} = {D11FE57E-1E57-491D-A1D4-01AEF4BE5CB6} {2C7836E7-B120-40A6-B641-DDAA02FBAE23} = {6F42AB98-9196-44C4-B888-D5E409F415A1} + {A0892896-F5BD-47E2-823E-DFCE82514EEC} = {9293CA11-360A-4C20-A674-B9E794431BF5} EndGlobalSection EndGlobal diff --git a/src/Ombi/ClientApp/app/search/tvsearch.component.ts b/src/Ombi/ClientApp/app/search/tvsearch.component.ts index 18b60faf5..f1c2cfa68 100644 --- a/src/Ombi/ClientApp/app/search/tvsearch.component.ts +++ b/src/Ombi/ClientApp/app/search/tvsearch.component.ts @@ -93,7 +93,7 @@ export class TvSearchComponent implements OnInit, OnDestroy { anticipatedShows() { this.clearResults(); - this.searchService.anticiplatedTv() + this.searchService.anticipatedTv() .takeUntil(this.subscriptions) .subscribe(x => { this.tvResults = x; diff --git a/src/Ombi/ClientApp/app/services/search.service.ts b/src/Ombi/ClientApp/app/services/search.service.ts index afef58f0c..e5330d477 100644 --- a/src/Ombi/ClientApp/app/services/search.service.ts +++ b/src/Ombi/ClientApp/app/services/search.service.ts @@ -48,7 +48,7 @@ export class SearchService extends ServiceAuthHelpers { mostWatchedTv(): Observable { return this.http.get(`${this.url}/Tv/mostwatched`).map(this.extractData); } - anticiplatedTv(): Observable { + anticipatedTv(): Observable { return this.http.get(`${this.url}/Tv/anticipated`).map(this.extractData); } trendingTv(): Observable { diff --git a/src/Ombi/Config/ApplicationSettings.cs b/src/Ombi/Config/ApplicationSettings.cs deleted file mode 100644 index 3caf6b2f2..000000000 --- a/src/Ombi/Config/ApplicationSettings.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Ombi.Config -{ - public class ApplicationSettings - { - public string Version { get; set; } - } -} \ No newline at end of file diff --git a/src/Ombi/Controllers/SearchController.cs b/src/Ombi/Controllers/SearchController.cs index 570206696..66a06c299 100644 --- a/src/Ombi/Controllers/SearchController.cs +++ b/src/Ombi/Controllers/SearchController.cs @@ -138,7 +138,7 @@ namespace Ombi.Controllers /// /// We use Trakt.tv as the Provider /// - [HttpGet("tv/anticiplated")] + [HttpGet("tv/anticipated")] public async Task> AnticiplatedTv() { return await TvEngine.Anticipated(); diff --git a/src/Ombi/Startup.cs b/src/Ombi/Startup.cs index d74c36ea2..28b4167bb 100644 --- a/src/Ombi/Startup.cs +++ b/src/Ombi/Startup.cs @@ -25,6 +25,7 @@ using Microsoft.IdentityModel.Tokens; using Ombi.Config; using Ombi.Core.IdentityResolver; using Ombi.DependencyInjection; +using Ombi.Helpers; using Ombi.Mapping; using Ombi.Schedule; using Ombi.Store.Context; diff --git a/src/Ombi/appsettings.json b/src/Ombi/appsettings.json index 0c4cfe68f..14aaf8125 100644 --- a/src/Ombi/appsettings.json +++ b/src/Ombi/appsettings.json @@ -6,7 +6,10 @@ } }, "ApplicationSettings": { - "Verison": "{{VERSIONNUMBER}}" + "Verison": "{{VERSIONNUMBER}}", + "OmbiService": "https://ombiservice.azurewebsites.net/", + "Branch": "{{BRANCH}}", + "FriendlyVersion": "v3.0.0" }, "UserSettings": { "WebsiteUrl": "http://localhost:52038",