mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 16:22:55 -07:00
Added a url base
This commit is contained in:
parent
68624f6971
commit
1af3c21655
11 changed files with 54 additions and 31 deletions
|
@ -33,7 +33,7 @@ namespace PlexRequests.Core.SettingModels
|
||||||
public class PlexRequestSettings : Settings
|
public class PlexRequestSettings : Settings
|
||||||
{
|
{
|
||||||
public int Port { get; set; }
|
public int Port { get; set; }
|
||||||
|
public string AssetLocation { get; set; }
|
||||||
public bool SearchForMovies { get; set; }
|
public bool SearchForMovies { get; set; }
|
||||||
public bool SearchForTvShows { get; set; }
|
public bool SearchForTvShows { get; set; }
|
||||||
public bool SearchForMusic { get; set; }
|
public bool SearchForMusic { get; set; }
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace PlexRequests.Core
|
||||||
{
|
{
|
||||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
private static DbConfiguration Db { get; set; }
|
private static DbConfiguration Db { get; set; }
|
||||||
public string SetupDb()
|
public string SetupDb(string assetLocation)
|
||||||
{
|
{
|
||||||
Db = new DbConfiguration(new SqliteFactory());
|
Db = new DbConfiguration(new SqliteFactory());
|
||||||
var created = Db.CheckDb();
|
var created = Db.CheckDb();
|
||||||
|
@ -52,7 +52,7 @@ namespace PlexRequests.Core
|
||||||
|
|
||||||
if (created)
|
if (created)
|
||||||
{
|
{
|
||||||
CreateDefaultSettingsPage();
|
CreateDefaultSettingsPage(assetLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
var version = CheckSchema();
|
var version = CheckSchema();
|
||||||
|
@ -89,7 +89,7 @@ namespace PlexRequests.Core
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateDefaultSettingsPage()
|
private void CreateDefaultSettingsPage(string assetLocation)
|
||||||
{
|
{
|
||||||
var defaultSettings = new PlexRequestSettings
|
var defaultSettings = new PlexRequestSettings
|
||||||
{
|
{
|
||||||
|
@ -97,7 +97,8 @@ namespace PlexRequests.Core
|
||||||
RequireMovieApproval = true,
|
RequireMovieApproval = true,
|
||||||
SearchForMovies = true,
|
SearchForMovies = true,
|
||||||
SearchForTvShows = true,
|
SearchForTvShows = true,
|
||||||
WeeklyRequestLimit = 0
|
WeeklyRequestLimit = 0,
|
||||||
|
AssetLocation = assetLocation ?? "assets"
|
||||||
};
|
};
|
||||||
var s = new SettingsServiceV2<PlexRequestSettings>(new SettingsJsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider()));
|
var s = new SettingsServiceV2<PlexRequestSettings>(new SettingsJsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider()));
|
||||||
s.SaveSettings(defaultSettings);
|
s.SaveSettings(defaultSettings);
|
||||||
|
|
|
@ -32,6 +32,7 @@ using Mono.Data.Sqlite;
|
||||||
using Nancy;
|
using Nancy;
|
||||||
using Nancy.Authentication.Forms;
|
using Nancy.Authentication.Forms;
|
||||||
using Nancy.Bootstrapper;
|
using Nancy.Bootstrapper;
|
||||||
|
using Nancy.Conventions;
|
||||||
using Nancy.Cryptography;
|
using Nancy.Cryptography;
|
||||||
using Nancy.Diagnostics;
|
using Nancy.Diagnostics;
|
||||||
using Nancy.Session;
|
using Nancy.Session;
|
||||||
|
@ -60,6 +61,8 @@ namespace PlexRequests.UI
|
||||||
// by overriding the various methods and properties.
|
// by overriding the various methods and properties.
|
||||||
// For more information https://github.com/NancyFx/Nancy/wiki/Bootstrapper
|
// For more information https://github.com/NancyFx/Nancy/wiki/Bootstrapper
|
||||||
|
|
||||||
|
private TinyIoCContainer _container;
|
||||||
|
|
||||||
protected override void ConfigureRequestContainer(TinyIoCContainer container, NancyContext context)
|
protected override void ConfigureRequestContainer(TinyIoCContainer container, NancyContext context)
|
||||||
{
|
{
|
||||||
container.Register<IUserMapper, UserMapper>();
|
container.Register<IUserMapper, UserMapper>();
|
||||||
|
@ -108,6 +111,7 @@ namespace PlexRequests.UI
|
||||||
TaskManager.TaskFactory = new PlexTaskFactory();
|
TaskManager.TaskFactory = new PlexTaskFactory();
|
||||||
TaskManager.Initialize(new PlexRegistry());
|
TaskManager.Initialize(new PlexRegistry());
|
||||||
TaskManager.Initialize(new MediaCacheRegistry());
|
TaskManager.Initialize(new MediaCacheRegistry());
|
||||||
|
_container = container;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
|
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
|
||||||
|
@ -132,7 +136,17 @@ namespace PlexRequests.UI
|
||||||
(sender, certificate, chain, sslPolicyErrors) => true;
|
(sender, certificate, chain, sslPolicyErrors) => true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void ConfigureConventions(NancyConventions nancyConventions)
|
||||||
|
{
|
||||||
|
base.ConfigureConventions(nancyConventions);
|
||||||
|
|
||||||
|
var settings = new SettingsServiceV2<PlexRequestSettings>(new SettingsJsonRepository(new DbConfiguration(new SqliteFactory()),new MemoryCacheProvider()));
|
||||||
|
var assetLocation = settings.GetSettings().AssetLocation;
|
||||||
|
nancyConventions.StaticContentsConventions.Add(
|
||||||
|
StaticContentConventionBuilder.AddDirectory("assets", $"{assetLocation}/Content")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
protected override DiagnosticsConfiguration DiagnosticsConfiguration => new DiagnosticsConfiguration { Password = @"password" };
|
protected override DiagnosticsConfiguration DiagnosticsConfiguration => new DiagnosticsConfiguration { Password = @"password" };
|
||||||
|
|
||||||
|
|
4
PlexRequests.UI/Content/bootstrap.css
vendored
4
PlexRequests.UI/Content/bootstrap.css
vendored
|
@ -269,8 +269,8 @@ th {
|
||||||
}
|
}
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Glyphicons Halflings';
|
font-family: 'Glyphicons Halflings';
|
||||||
src: url('../Content/fonts/glyphicons-halflings-regular.eot');
|
src: url('../assets/fonts/glyphicons-halflings-regular.eot');
|
||||||
src: url('../Content/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../Content/fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../Content/fonts/glyphicons-halflings-regular.woff') format('woff'), url('../Content/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../Content/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
|
src: url('../assets/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../assets/fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../assets/fonts/glyphicons-halflings-regular.woff') format('woff'), url('../assets/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../assets/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
|
||||||
}
|
}
|
||||||
.glyphicon {
|
.glyphicon {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
4
PlexRequests.UI/Content/font-awesome.css
vendored
4
PlexRequests.UI/Content/font-awesome.css
vendored
|
@ -6,8 +6,8 @@
|
||||||
* -------------------------- */
|
* -------------------------- */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'FontAwesome';
|
font-family: 'FontAwesome';
|
||||||
src: url('../Content/fonts/fontawesome-webfont.eot?v=4.5.0');
|
src: url('../assets/fonts/fontawesome-webfont.eot?v=4.5.0');
|
||||||
src: url('../Content/fonts/fontawesome-webfont.eot?#iefix&v=4.5.0') format('embedded-opentype'), url('../Content/fonts/fontawesome-webfont.woff2?v=4.5.0') format('woff2'), url('../Content/fonts/fontawesome-webfont.woff?v=4.5.0') format('woff'), url('../Content/fonts/fontawesome-webfont.ttf?v=4.5.0') format('truetype'), url('../Content/fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular') format('svg');
|
src: url('../assets/fonts/fontawesome-webfont.eot?#iefix&v=4.5.0') format('embedded-opentype'), url('../assets/fonts/fontawesome-webfont.woff2?v=4.5.0') format('woff2'), url('../assets/fonts/fontawesome-webfont.woff?v=4.5.0') format('woff'), url('../assets/fonts/fontawesome-webfont.ttf?v=4.5.0') format('truetype'), url('../assets/fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular') format('svg');
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
|
@ -462,6 +462,10 @@
|
||||||
<ReferenceCopyLocalPaths Remove="@(ReferenceSatellitePaths)" />
|
<ReferenceCopyLocalPaths Remove="@(ReferenceSatellitePaths)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Target>
|
</Target>
|
||||||
|
<PropertyGroup>
|
||||||
|
<PreBuildEvent>
|
||||||
|
</PreBuildEvent>
|
||||||
|
</PropertyGroup>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- 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.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
|
|
|
@ -46,6 +46,7 @@ namespace PlexRequests.UI
|
||||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
var assetLocation = "assets";
|
||||||
var port = -1;
|
var port = -1;
|
||||||
if (args.Length > 0)
|
if (args.Length > 0)
|
||||||
{
|
{
|
||||||
|
@ -53,17 +54,20 @@ namespace PlexRequests.UI
|
||||||
int portResult;
|
int portResult;
|
||||||
if (!int.TryParse(args[0], out portResult))
|
if (!int.TryParse(args[0], out portResult))
|
||||||
{
|
{
|
||||||
Console.WriteLine("Incorrect Port format. Press any key.");
|
Console.WriteLine("Didn't pass in a port");
|
||||||
Console.ReadLine();
|
Console.WriteLine("Must be the URL Base");
|
||||||
Environment.Exit(1);
|
assetLocation = args[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
port = portResult;
|
||||||
}
|
}
|
||||||
port = portResult;
|
|
||||||
}
|
}
|
||||||
Log.Trace("Getting product version");
|
Log.Trace("Getting product version");
|
||||||
WriteOutVersion();
|
WriteOutVersion();
|
||||||
|
|
||||||
var s = new Setup();
|
var s = new Setup();
|
||||||
var cn = s.SetupDb();
|
var cn = s.SetupDb(assetLocation);
|
||||||
s.CacheQualityProfiles();
|
s.CacheQualityProfiles();
|
||||||
ConfigureTargets(cn);
|
ConfigureTargets(cn);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
@Html.Partial("_Sidebar")
|
@Html.Partial("_Sidebar")
|
||||||
<link rel="stylesheet" type="text/css" href="~/Content/dataTables.bootstrap.css" />
|
<link rel="stylesheet" type="text/css" href="~/assets/dataTables.bootstrap.css" />
|
||||||
|
|
||||||
<script type="text/javascript" src="~/Content/datatables.min.js"></script>
|
<script type="text/javascript" src="~/assets/datatables.min.js"></script>
|
||||||
|
|
||||||
<div class="col-sm-8 col-sm-push-1">
|
<div class="col-sm-8 col-sm-push-1">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|
|
@ -403,6 +403,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/Content/requests.js" type="text/javascript"></script>
|
<script src="~/assets/requests.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -209,4 +209,4 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script src="/Content/search.js" type="text/javascript"></script>
|
<script src="~/assets/search.js" type="text/javascript"></script>
|
||||||
|
|
|
@ -7,21 +7,21 @@
|
||||||
<title>Plex Requests</title>
|
<title>Plex Requests</title>
|
||||||
<!-- Styles -->
|
<!-- Styles -->
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="~/Content/bootstrap.css" type="text/css"/>
|
<link rel="stylesheet" href="~/assets/bootstrap.css" type="text/css"/>
|
||||||
<link rel="stylesheet" href="~/Content/custom.min.css" type="text/css" />
|
<link rel="stylesheet" href="~/assets/custom.min.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="~/Content/font-awesome.css" type="text/css"/>
|
<link rel="stylesheet" href="~/assets/font-awesome.css" type="text/css"/>
|
||||||
<link rel="stylesheet" href="~/Content/pace.min.css" type="text/css"/>
|
<link rel="stylesheet" href="~/assets/pace.min.css" type="text/css"/>
|
||||||
|
|
||||||
|
|
||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
<script src="~/Content/jquery-2.2.1.min.js"></script>
|
<script src="~/assets/jquery-2.2.1.min.js"></script>
|
||||||
<script src="~/Content/handlebars.min.js"></script>
|
<script src="~/assets/handlebars.min.js"></script>
|
||||||
<script src="~/Content/bootstrap.min.js"></script>
|
<script src="~/assets/bootstrap.min.js"></script>
|
||||||
<script src="~/Content/bootstrap-notify.min.js"></script>
|
<script src="~/assets/bootstrap-notify.min.js"></script>
|
||||||
<script src="~/Content/site.js"></script>
|
<script src="~/assets/site.js"></script>
|
||||||
<script src="~/Content/pace.min.js"></script>
|
<script src="~/assets/pace.min.js"></script>
|
||||||
<script src="~/Content/jquery.mixitup.js"></script>
|
<script src="~/assets/jquery.mixitup.js"></script>
|
||||||
<script src="~/Content/moment.min.js"></script>
|
<script src="~/assets/moment.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue