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.
pull/35/head
tidusjar 9 years ago
parent b62b7c1305
commit 2e8bb783d9

@ -68,7 +68,7 @@ namespace PlexRequests.Core
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();
@ -89,6 +89,19 @@ namespace PlexRequests.Core
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);
}
}
}
}

@ -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) {

@ -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}}

Loading…
Cancel
Save