|
|
@ -25,6 +25,8 @@
|
|
|
|
// ************************************************************************/
|
|
|
|
// ************************************************************************/
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
using Microsoft.Owin.Hosting;
|
|
|
|
using Microsoft.Owin.Hosting;
|
|
|
|
|
|
|
|
|
|
|
|
using Mono.Data.Sqlite;
|
|
|
|
using Mono.Data.Sqlite;
|
|
|
@ -39,6 +41,11 @@ using PlexRequests.Store;
|
|
|
|
using PlexRequests.Store.Repository;
|
|
|
|
using PlexRequests.Store.Repository;
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using FluentScheduler;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using PlexRequests.Services;
|
|
|
|
|
|
|
|
using PlexRequests.UI.Jobs;
|
|
|
|
|
|
|
|
|
|
|
|
namespace PlexRequests.UI
|
|
|
|
namespace PlexRequests.UI
|
|
|
|
{
|
|
|
|
{
|
|
|
|
class Program
|
|
|
|
class Program
|
|
|
@ -85,6 +92,9 @@ namespace PlexRequests.UI
|
|
|
|
s.CacheQualityProfiles();
|
|
|
|
s.CacheQualityProfiles();
|
|
|
|
ConfigureTargets(cn);
|
|
|
|
ConfigureTargets(cn);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetupSchedulers();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (port == -1)
|
|
|
|
if (port == -1)
|
|
|
|
port = GetStartupPort();
|
|
|
|
port = GetStartupPort();
|
|
|
@ -132,7 +142,7 @@ namespace PlexRequests.UI
|
|
|
|
private static int GetStartupPort()
|
|
|
|
private static int GetStartupPort()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Log.Trace("Getting startup Port");
|
|
|
|
Log.Trace("Getting startup Port");
|
|
|
|
var port = 3579;
|
|
|
|
var port = 8080;
|
|
|
|
var service = new SettingsServiceV2<PlexRequestSettings>(new SettingsJsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider()));
|
|
|
|
var service = new SettingsServiceV2<PlexRequestSettings>(new SettingsJsonRepository(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);
|
|
|
@ -148,5 +158,12 @@ namespace PlexRequests.UI
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LoggingHelper.ConfigureLogging(connectionString);
|
|
|
|
LoggingHelper.ConfigureLogging(connectionString);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void SetupSchedulers()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
TaskManager.TaskFactory = new PlexTaskFactory();
|
|
|
|
|
|
|
|
TaskManager.Initialize(new PlexRegistry());
|
|
|
|
|
|
|
|
TaskManager.Initialize(new MediaCacheRegistry());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|