mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 06:00:50 -07:00
Finished the notes! Resolved #7
This commit is contained in:
parent
98c0a4f879
commit
a2f44cf8d2
10 changed files with 40 additions and 28 deletions
|
@ -37,12 +37,15 @@ namespace PlexRequests.Api.Models.Sonarr
|
|||
public string startupPath { get; set; }
|
||||
public string appData { get; set; }
|
||||
public string osVersion { get; set; }
|
||||
public bool isMonoRuntime { get; set; }
|
||||
public bool isMono { get; set; }
|
||||
public bool isLinux { get; set; }
|
||||
public bool isOsx { get; set; }
|
||||
public bool isWindows { get; set; }
|
||||
public string branch { get; set; }
|
||||
public bool authentication { get; set; }
|
||||
public int startOfWeek { get; set; }
|
||||
public string authentication { get; set; }
|
||||
public string sqliteVersion { get; set; }
|
||||
public string urlBase { get; set; }
|
||||
public string runtimeVersion { get; set; }
|
||||
}
|
||||
}
|
|
@ -95,10 +95,17 @@ namespace PlexRequests.Api
|
|||
throw new ApplicationException(message, response.ErrorException);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
var json = JsonConvert.DeserializeObject<T>(response.Content);
|
||||
|
||||
return json;
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Fatal(e);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public T DeserializeXml<T>(string input)
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace PlexRequests.Core
|
|||
|
||||
public StatusModel GetStatus()
|
||||
{
|
||||
var assemblyVersion = AssemblyHelper.GetAssemblyVersion();
|
||||
var assemblyVersion = AssemblyHelper.GetProductVersion();
|
||||
var model = new StatusModel
|
||||
{
|
||||
Version = assemblyVersion,
|
||||
|
@ -66,7 +66,7 @@ namespace PlexRequests.Core
|
|||
var latestVersionArray = latestRelease.Result.Name.Split(new[] { 'v' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var latestVersion = latestVersionArray.Length > 1 ? latestVersionArray[1] : string.Empty;
|
||||
|
||||
if (!latestVersion.Equals(AssemblyHelper.GetProductVersion(), StringComparison.InvariantCultureIgnoreCase))
|
||||
if (!latestVersion.Equals(assemblyVersion, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
model.UpdateAvailable = true;
|
||||
model.UpdateUri = latestRelease.Result.HtmlUrl;
|
||||
|
|
|
@ -136,7 +136,7 @@ $('#noteModal').on('show.bs.modal', function (event) {
|
|||
|
||||
var modal = $(this);
|
||||
modal.find('.theNoteSaveButton').val(id); // Add ID to the button
|
||||
var requestField = modal.find('input');
|
||||
var requestField = modal.find('.noteId');
|
||||
requestField.val(id); // Add ID to the hidden field
|
||||
});
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace PlexRequests.UI.Modules
|
|||
var settings = AuthSettings.GetSettings();
|
||||
if (settings?.PlexAuthToken == null)
|
||||
{
|
||||
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Plex is not setup yet, we need " });
|
||||
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Plex is not setup yet, you need to update your Authentication settings" });
|
||||
}
|
||||
try
|
||||
{
|
||||
|
|
|
@ -86,12 +86,14 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
Post["/register"] = x =>
|
||||
{
|
||||
var username = (string) Request.Form.Username;
|
||||
var exists = UserMapper.DoUsersExist();
|
||||
if (exists)
|
||||
{
|
||||
return Context.GetRedirect("~/register?error=true&username=" + (string)Request.Form.Username);
|
||||
return Context.GetRedirect("~/register?error=true&username=" + username);
|
||||
}
|
||||
var userId = UserMapper.CreateUser(Request.Form.Username, Request.Form.Password);
|
||||
var userId = UserMapper.CreateUser(username, Request.Form.Password);
|
||||
Session[SessionKeys.UsernameKey] = username;
|
||||
return this.LoginAndRedirect((Guid)userId);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace PlexRequests.UI.Modules
|
|||
Post["/clearissues"] = _ => ClearIssue((int)Request.Form.Id);
|
||||
|
||||
Post["/changeavailability"] = _ => ChangeRequestAvailability((int)Request.Form.Id, (bool)Request.Form.Available);
|
||||
Post["/addnote"] = _ => AddNote((int)Request.Form.Id, (string)Request.Form.noteArea);
|
||||
Post["/addnote"] = _ => AddNote((int)Request.Form.requestId, (string)Request.Form.noteArea);
|
||||
}
|
||||
|
||||
private IRepository<RequestedModel> Service { get; }
|
||||
|
@ -213,7 +213,7 @@ namespace PlexRequests.UI.Modules
|
|||
var originalRequest = Service.Get(requestId);
|
||||
if (originalRequest == null)
|
||||
{
|
||||
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Request does not exist to change the availability!" });
|
||||
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Request does not exist to add a note!" });
|
||||
}
|
||||
|
||||
originalRequest.AdminNote = noteArea;
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace PlexRequests.UI
|
|||
uri = $"http://localhost:{portResult}";
|
||||
}
|
||||
|
||||
Log.Trace("Getting assembly version");
|
||||
Log.Trace("Getting product version");
|
||||
WriteOutVersion();
|
||||
|
||||
var s = new Setup();
|
||||
|
@ -81,7 +81,7 @@ namespace PlexRequests.UI
|
|||
|
||||
private static void WriteOutVersion()
|
||||
{
|
||||
var assemblyVer = AssemblyHelper.GetAssemblyVersion();
|
||||
var assemblyVer = AssemblyHelper.GetProductVersion();
|
||||
Log.Info($"Version: {assemblyVer}");
|
||||
Console.WriteLine($"Version: {assemblyVer}");
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
<div class="list-group table-of-contents">
|
||||
@if (Context.Request.Path == "/admin")
|
||||
{
|
||||
<a class="list-group-item active" href="/admin">Plex Request Settings</a>
|
||||
<a class="list-group-item active" href="/admin">Plex Request</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="list-group-item" href="/admin">Plex Request Settings</a>
|
||||
<a class="list-group-item" href="/admin">Plex Request</a>
|
||||
}
|
||||
@if (Context.Request.Path == "/admin/authentication")
|
||||
{
|
||||
|
@ -21,28 +21,28 @@
|
|||
|
||||
@if (Context.Request.Path == "/admin/plex")
|
||||
{
|
||||
<a class="list-group-item active" href="/admin/plex">Plex Settings</a>
|
||||
<a class="list-group-item active" href="/admin/plex">Plex</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="list-group-item" href="/admin/plex">Plex Settings</a>
|
||||
<a class="list-group-item" href="/admin/plex">Plex</a>
|
||||
}
|
||||
@if (Context.Request.Path == "/admin/couchpotato")
|
||||
{
|
||||
<a class="list-group-item active" href="/admin/couchpotato">CouchPotato Settings</a>
|
||||
<a class="list-group-item active" href="/admin/couchpotato">CouchPotato</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<a class="list-group-item" href="/admin/couchpotato">CouchPotato Settings</a>
|
||||
<a class="list-group-item" href="/admin/couchpotato">CouchPotato</a>
|
||||
}
|
||||
@if (Context.Request.Path == "/admin/sonarr")
|
||||
{
|
||||
<a class="list-group-item active" href="/admin/sonarr">Sonarr Settings</a>
|
||||
<a class="list-group-item active" href="/admin/sonarr">Sonarr</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="list-group-item" href="/admin/sonarr">Sonarr Settings</a>
|
||||
<a class="list-group-item" href="/admin/sonarr">Sonarr</a>
|
||||
}
|
||||
@*<a class="list-group-item" href="/admin/sickbeard">Sickbeard Settings</a>*@
|
||||
|
||||
|
|
|
@ -150,14 +150,14 @@
|
|||
<li><a id="{{requestId}}" issue-select="2" class="dropdownIssue" href="#">Wrong Content</a></li>
|
||||
<li><a id="{{requestId}}" issue-select="3" class="dropdownIssue" href="#">Playback Issues</a></li>
|
||||
<li><a id="{{requestId}}" issue-select="4" class="dropdownIssue" data-identifier="{{requestId}}" href="#" data-toggle="modal" data-target="#myModal">Other</a></li>
|
||||
{{#if_eq admin true}}
|
||||
<li><a id="{{requestId}}" issue-select="4" class="note" data-identifier="{{requestId}}" href="#" data-toggle="modal" data-target="#noteModal">Add Note</a></li>
|
||||
|
||||
{{/if_eq}}
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
{{#if_eq admin true}}
|
||||
|
||||
<button id="{{requestId}}" data-identifier="{{requestId}}" style="text-align: right" value="false" href="#" class="btn btn-sm btn-info-outline note" data-toggle="modal" data-target="#noteModal">Add Note</button>
|
||||
|
||||
{{/if_eq}}
|
||||
</div>
|
||||
@* // TODO add Issues to the view *@
|
||||
</div>
|
||||
|
@ -195,7 +195,7 @@
|
|||
</div>
|
||||
<form method="POST" action="/requests/addnote" id="noteForm">
|
||||
<div class="modal-body">
|
||||
<input name="requestId" class="requestId" type="text" hidden="hidden" value="" />
|
||||
<input name="requestId" class="noteId" type="text" hidden="hidden" value="" />
|
||||
<textarea class="form-control form-control-custom" rows="3" id="noteArea" name="noteArea"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue