Skip to content

Commit

Permalink
Fixed #16 and #30
Browse files Browse the repository at this point in the history
We are now using the new request service and storing the requests as json blobs

Added the db migration code. This can be removed in the next few builds.
  • Loading branch information
tidusjar committed Mar 18, 2016
1 parent b62b7c1 commit 2e8bb78
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
17 changes: 15 additions & 2 deletions PlexRequests.Core/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void CreateDefaultSettingsPage()
s.SaveSettings(defaultSettings);
}

private void MigrateDb()
private void MigrateDb() // TODO: Remove when no longer needed
{
var repo = new GenericRepository<RequestedModel>(Db);
var records = repo.GetAll();
Expand All @@ -88,7 +88,20 @@ private void MigrateDb()
{
throw new SqliteException("Could not migrate the DB!");
}



if (result.Count != requestedModels.Length)
{
throw new SqliteException("Could not migrate the DB! count is different");
}


// Now delete the old requests
foreach (var oldRequest in requestedModels)
{
repo.Delete(oldRequest);
}

}
}
}
2 changes: 1 addition & 1 deletion PlexRequests.UI/Content/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ $(".theNoteSaveButton").click(function (e) {
if (checkJsonResponse(response)) {
generateNotify("Success! Added Note.", "success");
$("#myModal").modal("hide");
$('#adminNotesArea').html("<div>Note from Admin: " + comment + "</div>");
$('#adminNotesArea' + e.target.value).html("<div>Note from Admin: " + comment + "</div>");
}
},
error: function (e) {
Expand Down
2 changes: 1 addition & 1 deletion PlexRequests.UI/Views/Requests/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<div>Issue: {{issues}}</div>
{{/if}}
</div>
<div id="adminNotesArea">
<div id="adminNotesArea{{requestId}}">
{{#if adminNote}}
<div>Note from Admin: {{adminNote}}</div>
{{/if}}
Expand Down

0 comments on commit 2e8bb78

Please sign in to comment.