name changes

pull/843/head
Jamie.Rees 8 years ago
parent 796f0fc188
commit 6300c98bb7

@ -34,7 +34,7 @@ namespace Ombi.Api.Models.Notifications
[JsonConstructor]
public SlackNotificationBody()
{
username = "Plex Requests";
username = "Ombi";
}
[JsonIgnore]

@ -3,7 +3,7 @@
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Plex Requests .Net</title>
<title>Ombi</title>
<style media="all" type="text/css">
@media all {
.btn-primary table td:hover {
@ -135,7 +135,7 @@
<div class="content" style="box-sizing: border-box; display: block; Margin: 0 auto; max-width: 580px; padding: 10px;">
<!-- START CENTERED WHITE CONTAINER -->
<span class="preheader" style="color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;">Plex Requests</span>
<span class="preheader" style="color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;">Ombi</span>
<table class="main" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: #fff; border-radius: 3px;" width="100%">
<!-- START MAIN CONTENT AREA -->
@ -172,7 +172,7 @@
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" width="100%">
<tr>
<td class="content-block powered-by" style="font-family: sans-serif; vertical-align: top; padding-top: 10px; padding-bottom: 10px; font-size: 12px; color: #999999; text-align: center;" valign="top" align="center">
Powered by <a href="https://github.com/tidusjar/PlexRequests.Net" style="color: #999999; font-size: 12px; text-align: center; text-decoration: underline;">Plex Requests .Net</a>
Powered by <a href="https://github.com/tidusjar/Ombi" style="color: #999999; font-size: 12px; text-align: center; text-decoration: underline;">Ombi</a>
</td>
</tr>
</table>

@ -32,6 +32,8 @@ using Nancy.Responses;
using Nancy.Security;
using Nancy.Session;
using Ombi.Core.Models;
using Ombi.Core.SettingModels;
using Ombi.Core.Users;
using Ombi.Helpers;
using Ombi.Helpers.Permissions;
using Ombi.Store.Repository;
@ -40,16 +42,18 @@ namespace Ombi.Core
{
public class SecurityExtensions : ISecurityExtensions
{
public SecurityExtensions(IUserRepository userRepository, IResourceLinker linker, IPlexUserRepository plexUsers)
public SecurityExtensions(IUserRepository userRepository, IResourceLinker linker, IPlexUserRepository plexUsers, ISettingsService<UserManagementSettings> umSettings)
{
UserRepository = userRepository;
Linker = linker;
PlexUsers = plexUsers;
UserManagementSettings = umSettings;
}
private IUserRepository UserRepository { get; }
private IResourceLinker Linker { get; }
private IPlexUserRepository PlexUsers { get; }
private ISettingsService<UserManagementSettings> UserManagementSettings { get; }
public bool IsLoggedIn(NancyContext context)
{
@ -283,7 +287,12 @@ namespace Ombi.Core
private Permissions GetPermissions(string userName)
{
if (string.IsNullOrEmpty(userName)) return 0;
if (string.IsNullOrEmpty(userName))
{
// Username without auth
var s = UserManagementSettings.GetSettings();
return (Permissions)UserManagementHelper.GetPermissions(s);
}
var dbUser = UserRepository.GetUserByUsername(userName);

@ -37,6 +37,7 @@ namespace Ombi.Core.SettingModels
public bool ReportIssues { get; set; }
public bool UsersCanViewOnlyOwnRequests { get; set; }
public bool UsersCanViewOnlyOwnIssues { get; set; }
public bool BypassRequestLimit { get; set; }
// Features
public bool RecentlyAddedNotification { get; set; }

@ -166,7 +166,7 @@ namespace Ombi.Core.StatusChecker
{
DownloadUri = downloadLink,
ReleaseNotes = $"{branchDisplay} (See recent commits for details)",
ReleaseTitle = $"Plex Requests {branchDisplay}",
ReleaseTitle = $"Ombi {branchDisplay}",
NewVersion = branchResult.build.version,
UpdateUri = downloadLink,
CurrentVersion = fileversion

@ -46,6 +46,10 @@ namespace Ombi.Core.Users
{
permission += (int)Permissions.UsersCanViewOnlyOwnIssues;
}
if (settings.BypassRequestLimit)
{
permission += (int) Permissions.BypassRequestLimit;
}
return permission;

@ -3,7 +3,7 @@
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Plex Requests .Net</title>
<title>Ombi</title>
<style media="all" type="text/css">
@media all {
.btn-primary table td:hover {
@ -135,7 +135,7 @@
<div class="content" style="box-sizing: border-box; display: block; Margin: 0 auto; max-width: 580px; padding: 10px;">
<!-- START CENTERED WHITE CONTAINER -->
<span class="preheader" style="color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;">Plex Requests Recently Added</span>
<span class="preheader" style="color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;">Ombi Recently Added</span>
<table class="main" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: #fff; border-radius: 3px;" width="100%">
<!-- START MAIN CONTENT AREA -->

@ -134,7 +134,7 @@ namespace Ombi.Services.Notification
{
var email = new EmailBasicTemplate();
var html = email.LoadTemplate(
$"Plex Requests: New {model.RequestType.GetString()?.ToLower()} request for {model.Title}!",
$"Ombi: New {model.RequestType.GetString()?.ToLower()} request for {model.Title}!",
$"Hello! The user '{model.User}' has requested the {model.RequestType.GetString()?.ToLower()} '{model.Title}'! Please log in to approve this request. Request Date: {model.DateTime.ToString("f")}",
model.ImgSrc);
var body = new BodyBuilder { HtmlBody = html, TextBody = $"Hello! The user '{model.User}' has requested the {model.RequestType.GetString()?.ToLower()} '{model.Title}'! Please log in to approve this request. Request Date: {model.DateTime.ToString("f")}" };
@ -142,7 +142,7 @@ namespace Ombi.Services.Notification
var message = new MimeMessage
{
Body = body.ToMessageBody(),
Subject = $"Plex Requests: New {model.RequestType.GetString()?.ToLower()} request for {model.Title}!"
Subject = $"Ombi: New {model.RequestType.GetString()?.ToLower()} request for {model.Title}!"
};
message.From.Add(new MailboxAddress(settings.EmailSender, settings.EmailSender));
message.To.Add(new MailboxAddress(settings.RecipientEmail, settings.RecipientEmail));
@ -155,7 +155,7 @@ namespace Ombi.Services.Notification
{
var email = new EmailBasicTemplate();
var html = email.LoadTemplate(
$"Plex Requests: New issue for {model.Title}!",
$"Ombi: New issue for {model.Title}!",
$"Hello! The user '{model.User}' has reported a new issue {model.Body} for the title {model.Title}!",
model.ImgSrc);
var body = new BodyBuilder { HtmlBody = html, TextBody = $"Hello! The user '{model.User}' has reported a new issue {model.Body} for the title {model.Title}!"};
@ -163,7 +163,7 @@ namespace Ombi.Services.Notification
var message = new MimeMessage
{
Body = body.ToMessageBody(),
Subject = $"Plex Requests: New issue for {model.Title}!"
Subject = $"Ombi: New issue for {model.Title}!"
};
message.From.Add(new MailboxAddress(settings.EmailSender, settings.EmailSender));
message.To.Add(new MailboxAddress(settings.RecipientEmail, settings.RecipientEmail));
@ -176,7 +176,7 @@ namespace Ombi.Services.Notification
{
var email = new EmailBasicTemplate();
var html = email.LoadTemplate(
"Plex Requests: A request could not be added.",
"Ombi: A request could not be added.",
$"Hello! The user '{model.User}' has requested {model.Title} but it could not be added. This has been added into the requests queue and will keep retrying",
model.ImgSrc);
var body = new BodyBuilder { HtmlBody = html, TextBody = $"Hello! The user '{model.User}' has requested {model.Title} but it could not be added. This has been added into the requests queue and will keep retrying" };
@ -184,7 +184,7 @@ namespace Ombi.Services.Notification
var message = new MimeMessage
{
Body = body.ToMessageBody(),
Subject = $"Plex Requests: A request could not be added"
Subject = $"Ombi: A request could not be added"
};
message.From.Add(new MailboxAddress(settings.EmailSender, settings.EmailSender));
message.To.Add(new MailboxAddress(settings.RecipientEmail, settings.RecipientEmail));
@ -197,7 +197,7 @@ namespace Ombi.Services.Notification
{
var email = new EmailBasicTemplate();
var html = email.LoadTemplate(
"Plex Requests: Your request has been declined",
"Ombi: Your request has been declined",
$"Hello! Your request for {model.Title} has been declined, Sorry!",
model.ImgSrc);
var body = new BodyBuilder { HtmlBody = html, TextBody = $"Hello! Your request for {model.Title} has been declined, Sorry!", };
@ -205,7 +205,7 @@ namespace Ombi.Services.Notification
var message = new MimeMessage
{
Body = body.ToMessageBody(),
Subject = $"Plex Requests: Your request has been declined"
Subject = $"Ombi: Your request has been declined"
};
message.From.Add(new MailboxAddress(settings.EmailSender, settings.EmailSender));
message.To.Add(new MailboxAddress(model.UserEmail, model.UserEmail));
@ -218,7 +218,7 @@ namespace Ombi.Services.Notification
{
var email = new EmailBasicTemplate();
var html = email.LoadTemplate(
"Plex Requests: Your request has been approved!",
"Ombi: Your request has been approved!",
$"Hello! Your request for {model.Title} has been approved!",
model.ImgSrc);
var body = new BodyBuilder { HtmlBody = html, TextBody = $"Hello! Your request for {model.Title} has been approved!", };
@ -226,7 +226,7 @@ namespace Ombi.Services.Notification
var message = new MimeMessage
{
Body = body.ToMessageBody(),
Subject = $"Plex Requests: Your request has been approved!"
Subject = $"Ombi: Your request has been approved!"
};
message.From.Add(new MailboxAddress(settings.EmailSender, settings.EmailSender));
message.To.Add(new MailboxAddress(model.UserEmail, model.UserEmail));
@ -243,7 +243,7 @@ namespace Ombi.Services.Notification
}
var email = new EmailBasicTemplate();
var html = email.LoadTemplate(
$"Plex Requests: {model.Title} is now available!",
$"Ombi: {model.Title} is now available!",
$"Hello! You requested {model.Title} on PlexRequests! This is now available on Plex! :)",
model.ImgSrc);
var body = new BodyBuilder { HtmlBody = html, TextBody = $"Hello! You requested {model.Title} on PlexRequests! This is now available on Plex! :)" };
@ -251,7 +251,7 @@ namespace Ombi.Services.Notification
var message = new MimeMessage
{
Body = body.ToMessageBody(),
Subject = $"Plex Requests: {model.Title} is now available!"
Subject = $"Ombi: {model.Title} is now available!"
};
message.From.Add(new MailboxAddress(settings.EmailSender, settings.EmailSender));
message.To.Add(new MailboxAddress(model.UserEmail, model.UserEmail));

@ -111,28 +111,28 @@ namespace Ombi.Services.Notification
private async Task PushNewRequestAsync(NotificationModel model, PushbulletNotificationSettings settings)
{
var message = $"The {model.RequestType.GetString()?.ToLower()} '{model.Title}' has been requested by user: {model.User}";
var pushTitle = $"Plex Requests: The {model.RequestType.GetString()?.ToLower()} {model.Title} has been requested!";
var pushTitle = $"Ombi: The {model.RequestType.GetString()?.ToLower()} {model.Title} has been requested!";
await Push(settings, message, pushTitle);
}
private async Task PushIssueAsync(NotificationModel model, PushbulletNotificationSettings settings)
{
var message = $"A new issue: {model.Body} has been reported by user: {model.User} for the title: {model.Title}";
var pushTitle = $"Plex Requests: A new issue has been reported for {model.Title}";
var pushTitle = $"Ombi: A new issue has been reported for {model.Title}";
await Push(settings, message, pushTitle);
}
private async Task PushTestAsync(PushbulletNotificationSettings settings)
{
var message = "This is just a test! Success!";
var pushTitle = "Plex Requests: Test Message!";
var pushTitle = "Ombi: Test Message!";
await Push(settings, message, pushTitle);
}
private async Task PushFaultQueue(NotificationModel model, PushbulletNotificationSettings settings)
{
var message = $"Hello! The user '{model.User}' has requested {model.Title} but it could not be added. This has been added into the requests queue and will keep retrying";
var pushTitle = $"Plex Requests: The {model.RequestType.GetString()?.ToLower()} {model.Title} has been requested but could not be added!";
var pushTitle = $"Ombi: The {model.RequestType.GetString()?.ToLower()} {model.Title} has been requested but could not be added!";
await Push(settings, message, pushTitle);
}

@ -110,19 +110,19 @@ namespace Ombi.Services.Notification
private async Task PushNewRequestAsync(NotificationModel model, PushoverNotificationSettings settings)
{
var message = $"Plex Requests: The {model.RequestType.GetString()?.ToLower()} '{model.Title}' has been requested by user: {model.User}";
var message = $"Ombi: The {model.RequestType.GetString()?.ToLower()} '{model.Title}' has been requested by user: {model.User}";
await Push(settings, message);
}
private async Task PushIssueAsync(NotificationModel model, PushoverNotificationSettings settings)
{
var message = $"Plex Requests: A new issue: {model.Body} has been reported by user: {model.User} for the title: {model.Title}";
var message = $"Ombi: A new issue: {model.Body} has been reported by user: {model.User} for the title: {model.Title}";
await Push(settings, message);
}
private async Task PushTestAsync(NotificationModel model, PushoverNotificationSettings settings)
{
var message = $"Plex Requests: Test Message!";
var message = $"Ombi: Test Message!";
await Push(settings, message);
}

@ -111,7 +111,7 @@ namespace Ombi.Services.Notification
private async Task PushTest(SlackNotificationSettings settings)
{
var message = $"This is a test from Plex Requests, if you can see this then we have successfully pushed a notification!";
var message = $"This is a test from Ombi, if you can see this then we have successfully pushed a notification!";
await Push(settings, message);
}

@ -45,22 +45,44 @@ namespace Ombi.Store
}
private SqliteFactory Factory { get; }
public string CurrentPath =>Path.Combine(Path.GetDirectoryName(Application.ExecutablePath) ?? string.Empty, DbFile);
private string _currentPath;
public string CurrentPath
{
get
{
if (File.Exists(OldPath))
{
_currentPath = OldPath;
}
if (File.Exists(NewCurrentPath))
{
_currentPath = NewCurrentPath;
}
return _currentPath;
}
}
public string NewCurrentPath => Path.Combine(Path.GetDirectoryName(Application.ExecutablePath) ?? string.Empty, DbFile);
public string OldPath => Path.Combine(Path.GetDirectoryName(Application.ExecutablePath) ?? string.Empty, OldDbFile);
public virtual bool CheckDb()
{
Log.Trace("Checking DB");
Console.WriteLine("Location of the database: {0}",CurrentPath);
if (!File.Exists(CurrentPath))
if (File.Exists(CurrentPath))
{
Log.Trace("DB doesn't exist, creating a new one");
CreateDatabase();
return true;
return false;
}
return false;
Log.Trace("DB doesn't exist, creating a new one");
CreateDatabase();
return true;
}
public const string DbFile = "PlexRequests.sqlite";
public const string OldDbFile = "PlexRequests.sqlite";
public const string DbFile = "Ombi.sqlite";
/// <summary>
/// Gets the database connection.

@ -92,7 +92,7 @@ namespace Ombi.UI.Modules
Describe["GetApiKey"] = description => description.AsSwagger(with =>
{
with.ResourcePath("/apikey");
with.Summary("Gets the Api Key for Plex Requests");
with.Summary("Gets the Api Key for Ombi");
with.Model<ApiModel<string>>();
with.QueryParam<string>("username", required:true );
with.QueryParam<string>("password", required: true );

@ -39,7 +39,7 @@ namespace Ombi.UI.Modules
Describe["GetApiKey"] = description => description.AsSwagger(with =>
{
with.ResourcePath("/apikey");
with.Summary("Gets the Api Key for Plex Requests");
with.Summary("Gets the Api Key for Ombi");
with.Model<ApiModel<string>>();
with.QueryParam<string>("username", required:true );
with.QueryParam<string>("password", required: true );

@ -67,9 +67,9 @@ namespace Ombi.UI.Modules
{
return Response.AsJson(new JsonUpdateAvailableModel { UpdateAvailable = false });
}
//#if DEBUG
//return Response.AsJson(new JsonUpdateAvailableModel {UpdateAvailable = false});
//#endif
#if DEBUG
return Response.AsJson(new JsonUpdateAvailableModel { UpdateAvailable = false });
#endif
var checker = new StatusChecker(SystemSettings);
var release = await Cache.GetOrSetAsync(CacheKeys.LastestProductVersion, async() => await checker.GetStatus(), 30);

@ -94,9 +94,9 @@ namespace Ombi.UI
{
using (WebApp.Start<Startup>(options))
{
Console.WriteLine($"Plex Requests is running on the following: http://+:{port}/{baseUrl}");
Console.WriteLine($"Ombi is running on the following: http://+:{port}/{baseUrl}");
PrintToConsole("All setup, Plex Requests is now ready!", ConsoleColor.Yellow);
PrintToConsole("All setup, Ombi is now ready!", ConsoleColor.Yellow);
if (Type.GetType("Mono.Runtime") != null)
{
Log.Info("We are on Mono!");

@ -37,7 +37,7 @@ namespace Ombi.UI.Start
/// <value>
/// The base URL.
/// </value>
[Option('b',"base", Required = false, HelpText = "Provide a base url for Plex Requests")]
[Option('b',"base", Required = false, HelpText = "Provide a base url for Ombi")]
public string BaseUrl { get; set; }
/// <summary>
@ -46,7 +46,7 @@ namespace Ombi.UI.Start
/// <value>
/// The port.
/// </value>
[Option('p', "port", Required = false, HelpText = "Provide a port for Plex Requests to run on. You can also change this in the settings page in the UI", Default = 3579)]
[Option('p', "port", Required = false, HelpText = "Provide a port for Ombi to run on. You can also change this in the settings page in the UI", Default = 3579)]
public int Port { get; set; }

@ -40,7 +40,7 @@
<div class="form-group">
<label for="Username" class="control-label">Username Override</label>
<small class="control-label">You can override the default username (Plex Requests) here</small>
<small class="control-label">You can override the default username (Ombi) here</small>
<div class="">
<input type="text" class="form-control form-control-custom " id="Username" name="Username" value="@Model.Username">
</div>

@ -2,7 +2,7 @@
@using Nancy.Security
@using Ombi.Helpers.Permissions
@using Ombi.UI.Helpers
@using PlexRequests.UI.Resources
@using Ombi.UI.Resources
@{
var baseUrl = Html.GetBaseUrl();
var formAction = string.Empty;

@ -1,5 +1,5 @@
@using Ombi.UI.Helpers
@using PlexRequests.UI.Resources
@using Ombi.UI.Resources
@{
var baseUrl = Html.GetBaseUrl();
var url = string.Empty;

@ -13,7 +13,7 @@
<html>
<div hidden="hidden" id="baseUrl">@baseUrl.ToHtmlString()</div>
<head>
<title>Plex Requests</title>
<title>Ombi</title>
<!-- Styles -->
<meta name="viewport" content="width=device-width, initial-scale=1">
@Html.LoadAnalytics()

@ -2,7 +2,7 @@
@using Nancy.Session
@using Ombi.UI.Helpers
@using Ombi.UI.Resources
@using PlexRequests.UI.Resources
@using Ombi.UI.Resources
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<dynamic>
@{

@ -1,7 +1,7 @@
@using Nancy.Security
@using Nancy.Session
@using Ombi.UI.Helpers
@using PlexRequests.UI.Resources
@using Ombi.UI.Resources
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<dynamic>
<script>
var urlBase = '@Html.GetBaseUrl()';

@ -3,7 +3,7 @@
@using Nancy;
@using Ombi.Helpers
@using Ombi.UI.Helpers
@using PlexRequests.UI.Resources
@using Ombi.UI.Resources
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase
@{

@ -1,4 +1,4 @@
@using PlexRequests.UI.Resources
@using Ombi.UI.Resources
@{
var nullableError = Context.ViewBag.TempMessage ?? string.Empty;
var error = false;

@ -20,6 +20,7 @@
@Html.Checkbox(Model.ReportIssues, "ReportIssues", "Report Issues")
@Html.Checkbox(Model.UsersCanViewOnlyOwnIssues, "UsersCanViewOnlyOwnIssues", "Users can only view their own issues")
@Html.Checkbox(Model.UsersCanViewOnlyOwnRequests, "UsersCanViewOnlyOwnRequests", "Users can only view their own requests")
@Html.Checkbox(Model.BypassRequestLimit, "BypassRequestLimit", "Bypass the request limit")

@ -16,9 +16,9 @@
<div class="media">
<div id="contentBody" class="media-body">
<h4 class="media-heading landing-title" id="statusTitle">Welcome to Plex Requests</h4>
<h4 class="media-heading landing-title" id="statusTitle">Welcome to Ombi</h4>
<div class="form-group">
<small>we are just going to run though the initial Plex Requests setup!</small>
<small>we are just going to run though the initial Ombi setup!</small>
<div style="text-align: center; margin-top: 20px">
<a href="#" id="firstNext" class="btn btn-primary-outline">Next</a>
@ -44,7 +44,7 @@
<input type="password" class="form-control form-control-custom" id="password" name="Password" placeholder="Password">
</div>
</div>
<small>Please note we do not store this information, we only store your Plex Authorization Token that will allow Plex Requests to view your media and friends</small>
<small>Please note we do not store this information, we only store your Plex Authorization Token that will allow Ombi to view your media and friends</small>
<div class="form-group">
<div style="text-align: center; margin-top: 20px">
<button href="#" id="requestToken" class="btn btn-primary-outline">Request Token <i class="fa fa-key"></i></button>
@ -115,7 +115,7 @@
<script id="authArea" type="text/html">
<form method="post" action="@formAction/wizard/auth" id="authForm">
<div class="form-group">
<div class="checkbox userAuthTooltip" title="This will only allow the users that are your friends on Plex to log into Plex Requests. Note: They only need to enter their username, unless the below option is selected.">
<div class="checkbox userAuthTooltip" title="This will only allow the users that are your friends on Plex to log into Ombi. Note: They only need to enter their username, unless the below option is selected.">
<input type="checkbox" id="userAuth" name="UserAuthentication">
<label for="userAuth">Enable User Authentication</label>
</div>

Loading…
Cancel
Save