Added a url base

pull/158/head
tidusjar 9 years ago
parent 68624f6971
commit 1af3c21655

@ -33,7 +33,7 @@ namespace PlexRequests.Core.SettingModels
public class PlexRequestSettings : Settings
{
public int Port { get; set; }
public string AssetLocation { get; set; }
public bool SearchForMovies { get; set; }
public bool SearchForTvShows { get; set; }
public bool SearchForMusic { get; set; }

@ -44,7 +44,7 @@ namespace PlexRequests.Core
{
private static Logger Log = LogManager.GetCurrentClassLogger();
private static DbConfiguration Db { get; set; }
public string SetupDb()
public string SetupDb(string assetLocation)
{
Db = new DbConfiguration(new SqliteFactory());
var created = Db.CheckDb();
@ -52,7 +52,7 @@ namespace PlexRequests.Core
if (created)
{
CreateDefaultSettingsPage();
CreateDefaultSettingsPage(assetLocation);
}
var version = CheckSchema();
@ -89,7 +89,7 @@ namespace PlexRequests.Core
return version;
}
private void CreateDefaultSettingsPage()
private void CreateDefaultSettingsPage(string assetLocation)
{
var defaultSettings = new PlexRequestSettings
{
@ -97,7 +97,8 @@ namespace PlexRequests.Core
RequireMovieApproval = true,
SearchForMovies = true,
SearchForTvShows = true,
WeeklyRequestLimit = 0
WeeklyRequestLimit = 0,
AssetLocation = assetLocation ?? "assets"
};
var s = new SettingsServiceV2<PlexRequestSettings>(new SettingsJsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider()));
s.SaveSettings(defaultSettings);

@ -32,6 +32,7 @@ using Mono.Data.Sqlite;
using Nancy;
using Nancy.Authentication.Forms;
using Nancy.Bootstrapper;
using Nancy.Conventions;
using Nancy.Cryptography;
using Nancy.Diagnostics;
using Nancy.Session;
@ -60,6 +61,8 @@ namespace PlexRequests.UI
// by overriding the various methods and properties.
// For more information https://github.com/NancyFx/Nancy/wiki/Bootstrapper
private TinyIoCContainer _container;
protected override void ConfigureRequestContainer(TinyIoCContainer container, NancyContext context)
{
container.Register<IUserMapper, UserMapper>();
@ -108,6 +111,7 @@ namespace PlexRequests.UI
TaskManager.TaskFactory = new PlexTaskFactory();
TaskManager.Initialize(new PlexRegistry());
TaskManager.Initialize(new MediaCacheRegistry());
_container = container;
}
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
@ -132,7 +136,17 @@ namespace PlexRequests.UI
(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" };

@ -269,8 +269,8 @@ th {
}
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../Content/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');
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 {
position: relative;

@ -6,8 +6,8 @@
* -------------------------- */
@font-face {
font-family: 'FontAwesome';
src: url('../Content/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?v=4.5.0');
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-style: normal;
}

@ -462,6 +462,10 @@
<ReferenceCopyLocalPaths Remove="@(ReferenceSatellitePaths)" />
</ItemGroup>
</Target>
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<!-- 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">

@ -46,6 +46,7 @@ namespace PlexRequests.UI
private static Logger Log = LogManager.GetCurrentClassLogger();
static void Main(string[] args)
{
var assetLocation = "assets";
var port = -1;
if (args.Length > 0)
{
@ -53,17 +54,20 @@ namespace PlexRequests.UI
int portResult;
if (!int.TryParse(args[0], out portResult))
{
Console.WriteLine("Incorrect Port format. Press any key.");
Console.ReadLine();
Environment.Exit(1);
Console.WriteLine("Didn't pass in a port");
Console.WriteLine("Must be the URL Base");
assetLocation = args[0];
}
else
{
port = portResult;
}
port = portResult;
}
Log.Trace("Getting product version");
WriteOutVersion();
var s = new Setup();
var cn = s.SetupDb();
var cn = s.SetupDb(assetLocation);
s.CacheQualityProfiles();
ConfigureTargets(cn);

@ -1,7 +1,7 @@
@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">
<fieldset>

@ -403,6 +403,6 @@
</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 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>
<!-- Styles -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="~/Content/bootstrap.css" type="text/css"/>
<link rel="stylesheet" href="~/Content/custom.min.css" type="text/css" />
<link rel="stylesheet" href="~/Content/font-awesome.css" type="text/css"/>
<link rel="stylesheet" href="~/Content/pace.min.css" type="text/css"/>
<link rel="stylesheet" href="~/assets/bootstrap.css" type="text/css"/>
<link rel="stylesheet" href="~/assets/custom.min.css" type="text/css" />
<link rel="stylesheet" href="~/assets/font-awesome.css" type="text/css"/>
<link rel="stylesheet" href="~/assets/pace.min.css" type="text/css"/>
<!-- Scripts -->
<script src="~/Content/jquery-2.2.1.min.js"></script>
<script src="~/Content/handlebars.min.js"></script>
<script src="~/Content/bootstrap.min.js"></script>
<script src="~/Content/bootstrap-notify.min.js"></script>
<script src="~/Content/site.js"></script>
<script src="~/Content/pace.min.js"></script>
<script src="~/Content/jquery.mixitup.js"></script>
<script src="~/Content/moment.min.js"></script>
<script src="~/assets/jquery-2.2.1.min.js"></script>
<script src="~/assets/handlebars.min.js"></script>
<script src="~/assets/bootstrap.min.js"></script>
<script src="~/assets/bootstrap-notify.min.js"></script>
<script src="~/assets/site.js"></script>
<script src="~/assets/pace.min.js"></script>
<script src="~/assets/jquery.mixitup.js"></script>
<script src="~/assets/moment.min.js"></script>
</head>
<body>

Loading…
Cancel
Save