Small changes on the updater #1460 #865

pull/1510/head
Jamie.Rees 7 years ago
parent 2dd0478ea6
commit f7d67bf26d

@ -27,7 +27,7 @@ namespace Ombi.Core.Tests.Rule
var request = new BaseRequest() { RequestType = Store.Entities.RequestType.Movie };
var result = await Rule.Execute(request);
Assert.Equal(result.Success, true);
Assert.True(result.Success);
}
[Fact]
@ -37,8 +37,8 @@ namespace Ombi.Core.Tests.Rule
var request = new BaseRequest() { RequestType = Store.Entities.RequestType.Movie };
var result = await Rule.Execute(request);
Assert.Equal(result.Success, false);
Assert.Equal(string.IsNullOrEmpty(result.Message), false);
Assert.False(result.Success);
Assert.False(string.IsNullOrEmpty(result.Message));
}
[Fact]
@ -48,7 +48,7 @@ namespace Ombi.Core.Tests.Rule
var request = new BaseRequest() { RequestType = Store.Entities.RequestType.Movie };
var result = await Rule.Execute(request);
Assert.Equal(result.Success, true);
Assert.True(result.Success);
}
[Fact]
@ -58,7 +58,7 @@ namespace Ombi.Core.Tests.Rule
var request = new BaseRequest() { RequestType = Store.Entities.RequestType.TvShow };
var result = await Rule.Execute(request);
Assert.Equal(result.Success, true);
Assert.True(result.Success);
}
[Fact]
@ -68,7 +68,7 @@ namespace Ombi.Core.Tests.Rule
var request = new BaseRequest() { RequestType = Store.Entities.RequestType.TvShow };
var result = await Rule.Execute(request);
Assert.Equal(result.Success, true);
Assert.True(result.Success);
}
[Fact]
@ -78,8 +78,8 @@ namespace Ombi.Core.Tests.Rule
var request = new BaseRequest() { RequestType = Store.Entities.RequestType.TvShow };
var result = await Rule.Execute(request);
Assert.Equal(result.Success, false);
Assert.Equal(string.IsNullOrEmpty(result.Message), false);
Assert.False(result.Success);
Assert.False(string.IsNullOrEmpty(result.Message));
}
}
}

@ -31,8 +31,8 @@ namespace Ombi.Core.Tests.Rule.Search
var result = await Rule.Execute(search);
Assert.True(result.Success);
Assert.Equal(search.PlexUrl, "TestUrl");
Assert.Equal(search.Available, true);
Assert.Equal("TestUrl", search.PlexUrl);
Assert.True(search.Available);
}
[Fact]
@ -43,8 +43,8 @@ namespace Ombi.Core.Tests.Rule.Search
var result = await Rule.Execute(search);
Assert.True(result.Success);
Assert.Equal(search.PlexUrl, null);
Assert.Equal(search.Available, false);
Assert.Null(search.PlexUrl);
Assert.False(search.Available);
}
}
}

@ -32,8 +32,8 @@ namespace Ombi.Core.Tests.Rule.Search
var request = new SearchMovieViewModel { Id = 123 };
var result =await Rule.Execute(request);
Assert.Equal(result.Success, true);
Assert.Equal(request.Approved, true);
Assert.True(result.Success);
Assert.True(request.Approved);
}
@ -50,8 +50,8 @@ namespace Ombi.Core.Tests.Rule.Search
var request = new SearchMovieViewModel { Id = 123 };
var result = await Rule.Execute(request);
Assert.Equal(result.Success, true);
Assert.Equal(request.Approved, false);
Assert.True(result.Success);
Assert.False(request.Approved);
}
}
}

@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="AutoMapper" Version="6.1.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="2.0.1" />
<PackageReference Include="Hangfire" Version="1.6.14" />
<PackageReference Include="Hangfire" Version="1.6.16" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="1.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="1.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Design" Version="1.1.2" />
@ -33,13 +33,4 @@
<ProjectReference Include="..\Ombi.TheMovieDbApi\Ombi.Api.TheMovieDb.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Models\Requests\Movie\" />
<Folder Include="Models\Requests\Tv\" />
</ItemGroup>
<ItemGroup>
<None Include="Rule\Rules\Search\EmbyAvailabilityRule.cs" />
</ItemGroup>
</Project>

@ -6,9 +6,7 @@ namespace Ombi.Helpers
public static class AssemblyHelper
{
public static string GetRuntimeVersion() =>
Assembly.GetEntryAssembly().GetType()
.GetTypeInfo()
.Assembly
Assembly.GetEntryAssembly()
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
.InformationalVersion;
}

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="1.16.1" />
<PackageReference Include="MailKit" Version="1.18.1.1" />
</ItemGroup>
<ItemGroup>

@ -4,6 +4,7 @@ using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using Moq;
using NUnit.Framework;
using Ombi.Core.Notifications;
using Ombi.Schedule.Jobs.Plex;
using Ombi.Store.Entities;
using Ombi.Store.Entities.Requests;
@ -20,12 +21,15 @@ namespace Ombi.Schedule.Tests
_repo = new Mock<IPlexContentRepository>();
_tv = new Mock<ITvRequestRepository>();
_movie = new Mock<IMovieRequestRepository>();
Checker = new PlexAvailabilityChecker(_repo.Object, _tv.Object, _movie.Object);
_movie = new Mock<IMovieRequestRepository>();
_notify = new Mock<INotificationService>();
Checker = new PlexAvailabilityChecker(_repo.Object, _tv.Object, _movie.Object, _notify.Object);
}
private readonly Mock<IPlexContentRepository> _repo;
private readonly Mock<ITvRequestRepository> _tv;
private readonly Mock<IMovieRequestRepository> _movie;
private readonly Mock<INotificationService> _notify;
private PlexAvailabilityChecker Checker { get; }
[Test]

@ -48,7 +48,7 @@ namespace Ombi.Schedule.Jobs.Ombi
var updates = await OmbiService.GetUpdates(branch);
var serverVersion = updates.UpdateVersionString.Substring(1, 6);
var serverVersion = updates.UpdateVersionString;
Logger.LogInformation(LoggingEvents.Updater, "Service Version {0}", updates.UpdateVersionString);
@ -106,16 +106,21 @@ namespace Ombi.Schedule.Jobs.Ombi
}
// Download it
Logger.LogInformation(LoggingEvents.Updater, "Downloading the file {0} from {1}", download.Name, download.Url);
var extension = download.Name.Split('.').Last();
var zipDir = Path.Combine(currentLocation, $"Ombi.{extension}");
try
{
if (File.Exists(zipDir))
{
File.Delete(zipDir);
}
await DownloadAsync(download.Url, zipDir);
}
catch (Exception e)
{
Console.WriteLine(e);
Logger.LogError(LoggingEvents.Updater, e, "Error when downloading the zip");
throw;
}
@ -155,11 +160,6 @@ namespace Ombi.Schedule.Jobs.Ombi
}
}
else
{
// No updates
return;
}
}
public static async Task DownloadAsync(string requestUri, string filename)

@ -9,8 +9,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Hangfire" Version="1.6.14" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.6.14" />
<PackageReference Include="Hangfire" Version="1.6.16" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.6.16" />
<PackageReference Include="Hangfire.MemoryStorage.Core" Version="1.4.0" />
<PackageReference Include="Hangfire.RecurringJobExtensions" Version="1.1.6" />
<PackageReference Include="Serilog" Version="2.4.0" />

@ -2,7 +2,7 @@
"profiles": {
"Ombi.Updater": {
"commandName": "Project",
"commandLineArgs": "C:\\Users\\Jamie.Rees\\Source\\Repos\\PlexRequests.Net\\src\\Ombi\\bin\\Debug\\netcoreapp1.1\\"
"commandLineArgs": "C:\\Users\\Jamie.Rees\\Source\\Repos\\PlexRequests.Net\\src\\Ombi\\bin\\Debug\\netcoreapp1.1 zip"
}
}
}

@ -44,10 +44,9 @@
<ItemGroup>
<PackageReference Include="AutoMapper" Version="6.1.0" />
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.6.14" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.6.16" />
<PackageReference Include="Hangfire.MemoryStorage.Core" Version="1.4.0" />
<PackageReference Include="Hangfire.RecurringJobExtensions" Version="1.1.6" />
<PackageReference Include="Hangfire.SQLite.Core" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />

Loading…
Cancel
Save