This commit is contained in:
Jamie Rees 2016-03-16 22:12:15 +00:00
parent de84f0f191
commit 601a377d97
3 changed files with 35 additions and 28 deletions

View file

@ -385,11 +385,16 @@
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.99.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.99.0\build\net46\System.Data.SQLite.Core.targets'))" /> <Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.99.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.99.0\build\net46\System.Data.SQLite.Core.targets'))" />
</Target> </Target>
<Import Project="..\packages\System.Data.SQLite.Core.1.0.99.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.99.0\build\net46\System.Data.SQLite.Core.targets')" /> <Import Project="..\packages\System.Data.SQLite.Core.1.0.99.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.99.0\build\net46\System.Data.SQLite.Core.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <Target Name="RemoveSatelliteAssemblies" AfterTargets="ResolveAssemblyReferences">
Other similar extension points exist, see Microsoft.Common.targets. <ItemGroup>
<Target Name="BeforeBuild"> <ReferenceCopyLocalPaths Remove="@(ReferenceSatellitePaths)" />
</Target> </ItemGroup>
<Target Name="AfterBuild"> </Target>
</Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
--> -->
</Project> </Project>

View file

@ -59,20 +59,25 @@ namespace PlexRequests.UI
Console.ReadLine(); Console.ReadLine();
Environment.Exit(1); Environment.Exit(1);
} }
uri = $"http://localhost:{portResult}"; uri = $"http://*:{portResult}";
} }
Log.Trace("Getting product version"); Log.Trace("Getting product version");
WriteOutVersion(); WriteOutVersion();
var s = new Setup(); var s = new Setup();
s.SetupDb(); s.SetupDb();
if(string.IsNullOrEmpty(uri)) if (string.IsNullOrEmpty(uri))
uri = GetStartupUri(); uri = GetStartupUri();
StartOptions options = new StartOptions();
var newPort = GetPort(); ;
options.Urls.Add($"http://*:{newPort}"); var options = new StartOptions(uri)
{
ServerFactory = "Microsoft.Owin.Host.HttpListener"
};
try
{
using (WebApp.Start<Startup>(options)) using (WebApp.Start<Startup>(options))
{ {
@ -80,6 +85,13 @@ var newPort = GetPort();
Console.WriteLine("Press any key to exit"); Console.WriteLine("Press any key to exit");
Console.ReadLine(); Console.ReadLine();
} }
}
catch (Exception e)
{
var a = e.Message;
throw;
}
} }
private static void WriteOutVersion() private static void WriteOutVersion()
@ -92,28 +104,18 @@ var newPort = GetPort();
private static string GetStartupUri() private static string GetStartupUri()
{ {
Log.Trace("Getting startup URI"); Log.Trace("Getting startup URI");
var uri = "http://localhost:3579/"; var uri = "http://*:3579/";
var service = new SettingsServiceV2<PlexRequestSettings>(new JsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider())); var service = new SettingsServiceV2<PlexRequestSettings>(new JsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider()));
var settings = service.GetSettings(); var settings = service.GetSettings();
Log.Trace("Port: {0}", settings.Port); Log.Trace("Port: {0}", settings.Port);
if (settings.Port != 0) if (settings.Port != 0)
{ {
uri = $"http://localhost:{settings.Port}"; uri = $"http://*:{settings.Port}";
} }
return uri; return uri;
} }
private static int GetPort()
{
var service = new SettingsServiceV2<PlexRequestSettings>(new JsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider()));
var settings = service.GetSettings();
return settings.Port;
}
private static void ConfigureTargets(string connectionString) private static void ConfigureTargets(string connectionString)
{ {
LogManager.ThrowExceptions = true; LogManager.ThrowExceptions = true;
@ -159,7 +161,7 @@ private static int GetPort()
// Step 5. Activate the configuration // Step 5. Activate the configuration
LogManager.Configuration = config; LogManager.Configuration = config;
} }
catch (Exception ) catch (Exception)
{ {
throw; throw;

View file

@ -3,9 +3,9 @@ configuration: Release
assembly_info: assembly_info:
patch: true patch: true
file: '**\AssemblyInfo.*' file: '**\AssemblyInfo.*'
assembly_version: '1.2.0' assembly_version: '1.2.1'
assembly_file_version: '{version}' assembly_file_version: '{version}'
assembly_informational_version: '1.2.0' assembly_informational_version: '1.2.1'
before_build: before_build:
- cmd: appveyor-retry nuget restore - cmd: appveyor-retry nuget restore
build: build: