1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-29 14:27:41 +00:00

Update python search Metadata

This commit is contained in:
Ozzie Isaacs
2021-07-08 19:14:38 +02:00
parent aa2d3d2b36
commit ec7803fa76
6 changed files with 52 additions and 21 deletions

View File

@@ -73,6 +73,28 @@ $(function () {
}
}
function populate_provider() {
$("#metadata_provider").empty();
$.ajax({
url: getPath() + "/metadata/provider",
type: "get",
dataType: "json",
success: function success(data) {
console.log(data);
data.forEach(function(provider) {
//$("#metadata_provider").html("<ul id=\"book-list\" class=\"media-list\"></ul>");
var checked = "";
if (provider.active) {
checked = "checked";
}
var $provider_button = '<input type="checkbox" id="show-' + provider.name + '" class="pill" data-control="' + provider.id + '" ' + checked + '><label for="show-' + provider.name + '">' + provider.name + ' <span class="glyphicon glyphicon-ok"></span></label>'
$("#metadata_provider").append($provider_button);
});
},
});
}
$("#meta-search").on("submit", function (e) {
e.preventDefault();
var keyword = $("#keyword").val();
@@ -80,10 +102,9 @@ $(function () {
});
$("#get_meta").click(function () {
populate_provider();
var bookTitle = $("#book_title").val();
if (bookTitle) {
$("#keyword").val(bookTitle);
doSearch(bookTitle);
}
$("#keyword").val(bookTitle);
doSearch(bookTitle);
});
});